Click here to Skip to main content
15,906,081 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to stop the button's click event on page refresh?
I have multiple button sin my form.
I tried -
1. Redirect to same page.
2. View state Session approach

is there any other option available?

Thanks
Posted
Comments
Richard C Bishop 4-Sep-13 10:37am    
A button's click event is not fired on page load. If you want the button not to post-back, just set the button's autopostback property to false.

Response.Redirect("Your aspx Page");
 
Share this answer
 
Try this links for the problem,, i hope you will get a solution for the problem


http://csharpdotnetfreak.blogspot.com/2008/12/detect-browser-refresh-to-avoid-events.html[^]

Refresh Page Issue in ASP.Net[^]
 
Share this answer
 
 
Share this answer
 
hi,
link which may help you

Avoid button click event on page refresh

http://aspsnippets.com/Articles/Detect-Browser-Refresh-and-avoid-Events-fire-in-ASPNet.aspx[^]

http://www.aspdotnet-suresh.com/2010/04/detect-browser-refresh-to-avoid-events.html[^]



you can also use IsPostback on page load
for example

C#
protected void Page_Load(object sender, EventArgs e)
 {
     if(!Page.IsPostback)
       {
     //Code to start timer.
       }
}
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900