web application problem
-
hi all, i develope a web application in visual studio 2005, my problem is when i click save button(server side) to insert data into database the insertion done, but if i click F5 or (Refresh,Reload) for the page the insertion done another time( insert the data twice). how i can solve this problem? thanks to all
-
hi all, i develope a web application in visual studio 2005, my problem is when i click save button(server side) to insert data into database the insertion done, but if i click F5 or (Refresh,Reload) for the page the insertion done another time( insert the data twice). how i can solve this problem? thanks to all
-
You need to check whether page is postback. Put your database insertion code inside following condition.
if(!IsPostback)
{}
HTH
Jinal Desai - LIVE Experience is mother of sage....
i do that but the first time insertion in this case not done
-
hi all, i develope a web application in visual studio 2005, my problem is when i click save button(server side) to insert data into database the insertion done, but if i click F5 or (Refresh,Reload) for the page the insertion done another time( insert the data twice). how i can solve this problem? thanks to all
-
hi all, i develope a web application in visual studio 2005, my problem is when i click save button(server side) to insert data into database the insertion done, but if i click F5 or (Refresh,Reload) for the page the insertion done another time( insert the data twice). how i can solve this problem? thanks to all
After saving the information in database simply redirect to the current page. For instance, if your page name is insert.aspx then after saving the record write : Response.Redirect("insert.aspx"); This will prevent the page from raising postback on refresh.