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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:23:59+00:00 2026-05-16T22:23:59+00:00

I had three image buttons they had default image url and I tried to

  • 0

I had three image buttons they had default image url and I tried to change image url when user click on any image button and the default retrieve when user click to other image button tried to do that but I did not

<aspx>
<div class="hom_but_sa hom_but_saR">
    <asp:ImageButton ID="BTNPromotion" ImageUrl="images/home-bu_npro.jpg"
        runat="server" Width="134" Height="34" border="0"
        OnClick="BTNPromotion_Click" />
</div>
<div class="hom_but_a hom_but_sbR">
    <asp:ImageButton ID="BTNNewProduct" ImageUrl="images/home-bu_pro.jpg"
        runat="server" Width="134" Height="34" border="0" 
        OnClick="BTNNewProduct_Click" />
</div>
<div class="hom_but_a">
    <asp:ImageButton ID="BTNEvent" runat="server" ImageUrl="images/home-bu_news.jpg"
        Width="134" Height="34" border="0" OnClick="BTNEvent_Click" />
</div>
</div>

<cs>
protected void BTNEvent_Click(object sender, ImageClickEventArgs e)
{        
    BTNEvent.ImageUrl = "images/home-bu_news.jpg";      
}
protected void BTNNewProduct_Click(object sender, ImageClickEventArgs e)
{
    BTNNewProduct.ImageUrl = "images/home-bu_pro_r.jpg";
}
protected void BTNPromotion_Click(object sender, ImageClickEventArgs e)
{     
    BTNPromotion.ImageUrl = "images/home-bu_npro_r.jpg";
}
  • 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-16T22:24:00+00:00Added an answer on May 16, 2026 at 10:24 pm

    As per my comments I am not sure what you actual problem is but maybe you want some sort of toggle like this?

    protected void BTNEvent_Click(object sender, ImageClickEventArgs e) 
    {         
        BTNEvent.ImageUrl = "images/home-bu_news_r.jpg";
        BTNNewProduct.ImageUrl = "images/home-bu_pro.jpg"; 
        BTNPromotion.ImageUrl = "images/home-bu_npro.jpg"; 
    } 
    protected void BTNNewProduct_Click(object sender, ImageClickEventArgs e) 
    { 
        BTNEvent.ImageUrl = "images/home-bu_news.jpg";
        BTNNewProduct.ImageUrl = "images/home-bu_pro_r.jpg"; 
        BTNPromotion.ImageUrl = "images/home-bu_npro.jpg"; 
    
    } 
    protected void BTNPromotion_Click(object sender, ImageClickEventArgs e) 
    {      
        BTNEvent.ImageUrl = "images/home-bu_news.jpg";
        BTNNewProduct.ImageUrl = "images/home-bu_pro.jpg"; 
        BTNPromotion.ImageUrl = "images/home-bu_npro_r.jpg"; 
    } 
    

    A cleaner way would be to just have one click event handle it by attaching one event to all the ImageButton OnClick:

    OnClick="BTN_Click"
    

    Then implement the Click like:

    protected void BTN_Click(object sender, ImageClickEventArgs e)
    {
        ImageButton btn = (ImageButton)(sender);
        BTNEvent.ImageUrl = (btn.ID.Equals("BTNEvent")) ? 
            "images/home-bu_news_r.jpg" : "images/home-bu_news.jpg";
        BTNNewProduct.ImageUrl = (btn.ID.Equals("BTNNewProduct")) ?
            "images/home-bu_pro_r.jpg" : "images/home-bu_pro.jpg";
        BTNPromotion.ImageUrl = (btn.ID.Equals("BTNPromotion")) ?
            "images/home-bu_npro_r.jpg" : "images/home-bu_npro.jpg";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanted to create a button that had an image and a textblock as
I added a FULLTEXT index on three of my columns, after I already had
So I have a button that I have cut in three parts, left, repeating
If you have ever had to make you own custom buttons for Android then
I have a button that features a grid which in turn contains an image.
On Android, I would like to create a button that contains some other Views.
I am setting up a UINavigationBar with 2 buttons that change their title when
I originally had a submit button like this <form action=<?php $self ?> method=post >
I had created a small app such that the image which is displaying should
After clicking on an image, the user is redirected to a new page like:

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.