Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7508029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:36:15+00:00 2026-05-29T22:36:15+00:00

Peter here and I’m extra new to coding. What I’m attempting to do is

  • 0

Peter here and I’m extra new to coding. What I’m attempting to do is check the actual image url and based on that, change the class. My current code is as so:

DataSet ds = cbb.getBannerModule(Convert.ToInt32(MyBannerID));
    ImageButton ib = new ImageButton();
    ib.ImageUrl =  ds.Tables[0].Rows[0]["Banner_path"].ToString();
    string URL = ib.ImageUrl;
    ib.Width = Unit.Pixel(Convert.ToInt32(ds.Tables[0].Rows[0]["Banner_width"].ToString()));
    ib.Height = Unit.Pixel(Convert.ToInt32(ds.Tables[0].Rows[0]["Banner_hight"].ToString()));
    ib.PostBackUrl = ds.Tables[0].Rows[0]["Banner_link"].ToString();
    string img1 = "~/admin/IMAGE/Banner/1.jpg";
    string img2 = "~/admin/IMAGE/Banner/2.jpg";
    string img3 = "~/admin/IMAGE/Banner/3.jpg";
    if (URL == img1)
    {
        ban1.Attributes["class"] = "add 1";
    }
    else if (URL == img2)
    {
        ban1.Attributes["class"] = "add 2";
    }
    else if (URL == img3)
    {
        ban1.Attributes["class"] = "add 3";
    }
    else
    {
        ban1.Attributes["class"] = "add 4";
    }
    ban1.Controls.Add(ib);

The goal? Change the class to attempt and set a new picture for the hover feature. This is a system created by an outside vendor and the id and class are set inside the ascx file. They set it class=”add” but I want to add another class so that when you rollover the image it changes the image. Is that possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T22:36:16+00:00Added an answer on May 29, 2026 at 10:36 pm

    Classes name need to be in a single word. You cannot have “add 1” as a single name. Space is to separate multiple class for a single Dom object.

    If you want, you can change too “add1” instead of “add 1” and so on. This will set the class to your image to “add1” instead of “add” and “1”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My goal is to have the url routing as following: http://www.abc.com/this-is-peter-page http://www.abc.com/this-is-john-page What is
I have been creating a peer to peer connection for a new game, that
Well the problem here is that if you have one DataTemplate for a type
That is, in Mercurial, if Peter cloned from me by hg clone c:\mycode e:\code
http://piratepad.net/IY48xXzsys (modified by Peter West, from the original here: http://paulbutler.org/archives/a-simple-diff-algorithm-in-php/ ) Currently a diff
I was wondering if you guys could help me. Here are my .h: Class
I'm using Peter Deutsch's implementation of MD5 to implement a simple password check. I
Folks, Here is a simplified code for my background thread: public class MyThread extends
Here's the problem in a nutshell: <bean id=handlerFactory class=com.westfieldgrp.audit.jdklogging.cpm.CPMHandlerFactory> <property name=schemaName value=${env.audit.databaseSchema} /> <property
Answer update, 12/22 : Using Peter Shor's observation that there's a homomorphism between distinct

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.