Click here to Skip to main content
15,908,909 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all ,
i'm developing an application (asp.net) with C# ...
i use a button for inserting data in my app , when i refresh my web page the data will be stored again !!
what is the problem ?!
Posted
Comments
Kornfeld Eliyahu Peter 26-Oct-13 16:20pm    
It's hard to say without some code sample...
You may add a simplified - not working - version of your page...
Anurag Sinha V 26-Oct-13 16:20pm    
Try to use IsPostBack property

You are searching for this.Check this:
detect browser refresh to avoid events[^]

or
Use this:

After insert or update statement is executed place this code
Response.Redirect(Request.Url.AbsoluteUri);
 
Share this answer
 
Asp.net webpage postback request maintain viewstate becuase of that it fires last event when page is refereshed
you can make a fresh request after inserting data using response.redirect

Hope this helps!!!
 
Share this answer
 

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