Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi to all.,

I have problem with refreshing web page after inserting data.

I m inserting data from some web controls with submit button, after clicking Submit button data is inserting properly, but once after inserting the data if i pressed Refresh (F5) button the same Submit button triggering and data inserting from those same controls once again.
so i don't want this happening after refresh.

any solution..??
Posted
Updated 28-Jul-11 20:08pm
v2
Comments
Praveen Kullu 29-Jul-11 2:14am    
Please Show your codes for Page_load event and Submit button event.
[no name] 29-Jul-11 2:51am    
put a check if not postback execute the code

Put insert code in
if(!Page.isPostBack)
{
   //insert code..
}

And..there you go!
 
Share this answer
 
Comments
Manas Bhardwaj 29-Jul-11 10:05am    
As far as information provided, spot on. +5
Tech Code Freak 30-Jul-11 5:28am    
Thanks!
One way is to redirect to same page after the insertion.
 
Share this answer
 
You have to apply check method before inserting the value.
 
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