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 3231482
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:03:02+00:00 2026-05-17T17:03:02+00:00

there’s a label control on my master page..if its value is Value1 ,I want

  • 0

there’s a label control on my master page..if its value is “Value1” ,I want this CSS Sprite to display on my webform..if the Value is “Value2”..the CSS sprite should use some different image..just the image needs to be changed ..nothing else in that Sprite..

I found out that I can use “FindControl” method to find out what value that Label Control of Master Page’s currently got..

Now how do I change that image on the banner ?? How do I go about it ? Also that CSS Sprite now is a user control named “myBanner.ascx”(earlier was an aspx file)..Now do I need to make 2 diff usercontrols or I can implement some logic in one usercontrol itself ?

Should I make 2 copies of this “myBanner.ascx” with JUST the “image name” changed in its CSS ???

Hope its not confusing..Actually I am lost :/

What I want is ONE banner which has been made using CSS Sprite ..Now if the “Label Control’s “value in the master page is “Value1” then the image to be used on that banner is “IMAGE1” else if “Label Control’s” value is “Value2” then “IMAGE2” should be used in that sprite..

How do I go about it ? Need just ideas..thnx

  • 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-17T17:03:03+00:00Added an answer on May 17, 2026 at 5:03 pm

    hmm maybe i’m not understanding this correctly but why don’t you make the usercontrol finds the master’s label (findcontrol); check the values; and then display the correct image.

    the way to display the image you can either have a local variable (in the usercontrol) where you then just drop it in like <%=ImagePath%> and have the check in the pageload

    or you can have a method which checks the label like:

    <div id="banner" style="background-image:url(<%=GetImagePath()%>);"></div>
    

    backend

    protected string GetImagePath() {
     string s = ((Label)this.Page.Master.FindControl("label1")).Text;
     //if ... etc
    }
    

    I hope this is what you are looking for otherwise let me know so I can modify my answer

    good luck!

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

Sidebar

Related Questions

There is a <input type=checkbox name=option2 id=checkbox_3 value=3 /> I tried this code <script
There is a column that exists in 2 tables. In table 1, this column
There are nice SO question and answers about this issue, but these options didn't
There are two table s : one is the master and one the detail
There is this strange situation I'm fighting on. I have 3 pages, les call
There are a lot of Jquery plugins and libraries. and sometimes I want to
There have been multiple questions regarding this topic but I have never really settled
There is my code that I want to alert test once when mousemove ,
There is a constructor of lucene Field: Field(String name, String value, Store store, Index
I know there's a lot of other questions out there that deal with this

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.