OnMouseOver="this.src='Images/Button/Button-Home2.gif'"
onmouseout="this.src='Images/Button/Button-Home.gif'"
/>
By the above code i can able to chage image (Button-Home.gif to Button-Home2.gif )
Now my problem is that i want to fix image (Button-Home2.gif) fix if i click on the image button.
How can i do this?

Amit ChoudharyPosted Jul 5, 2010, 12:41 AM
try to create your button attributes dynamically at run time.. and set a bool variable there to check if image clicked once.
set client event on page_load event:
take a static bool flag:
if(!Flag)
{
ImageButton1.Attributes["onmouseover"]="this.src='Images/Button/Button-Home2.gif' ";
// similary other lines... like this..
}
on your button click event remove these attributes.
and set flag to true.
hope you got my point.
Vikas AhlawatPosted Jul 4, 2010, 11:06 AM
Deepak BhatiaPosted Jul 4, 2010, 10:37 AM
Vikas AhlawatPosted Jul 4, 2010, 10:12 AM
i not understand your break ...
can you put coding here
Deepak BhatiaPosted Jul 4, 2010, 10:02 AM
Main problem is that when you redirect explicitly to same page, a fresh page is loaded and the old page is lost as if you debug and place a break at page load fuction it will be hit twice when you hit image button.
Vikas AhlawatPosted Jul 4, 2010, 9:59 AM
http://www.4shared.com/file/2_fXPSUf/Ahlawattechnology.html
Vikas AhlawatPosted Jul 4, 2010, 9:40 AM
I have already try it
if (buttonflag == false)
{
buttonflag = true;
ImageButton1.ImageUrl = "Images/Button/Button-Home2.gif";
}
Response.Redirect("~/Home.aspx");
if i make Response.Redirect("~/Home.aspx"); as comment the it work
otherwise it not woking
Deepak BhatiaPosted Jul 4, 2010, 9:33 AM
When you click the button image, button click event will be fired,
In that event just write these lines,
ImageButton1.ImageUrl="Images/Button/Button-Home2.gif'"