refresh problem
-
i have a button that is contain the code that call the stored procedure . the stored procedure is execute insert sql statment and add record to the data base that is in sql server . when i pressed the button the record is added well and go to the database. the problem is when i click refresh for the browser on this page the record is added again on the database . why & how can solve this problem ?
dead
-
i have a button that is contain the code that call the stored procedure . the stored procedure is execute insert sql statment and add record to the data base that is in sql server . when i pressed the button the record is added well and go to the database. the problem is when i click refresh for the browser on this page the record is added again on the database . why & how can solve this problem ?
dead
What happens is when an event gets fired(postback) the event source gets stored and when you clicks on the refresh button then the event gets again fired. One simple way to get rid of the problem is to redirect to the same page after execution of the event.
Best Regards, Apurva Kaushal
-
What happens is when an event gets fired(postback) the event source gets stored and when you clicks on the refresh button then the event gets again fired. One simple way to get rid of the problem is to redirect to the same page after execution of the event.
Best Regards, Apurva Kaushal
-
thank you this is working well but the sqldatasource that read from database is dont work when i click refresh and i need to show the last data record inserted . can i do this ?
dead
If i have understood your problem correctly then after inserting the data into the database you want to display the inserted data to the user. If this is the case then you can't directly redirect to the same page you send some value in the querystring and then in the load event of the page just check the querystring value if it is present then get the newly inserted data and display it. Hope it will serve the purpose.
Best Regards, Apurva Kaushal
-
If i have understood your problem correctly then after inserting the data into the database you want to display the inserted data to the user. If this is the case then you can't directly redirect to the same page you send some value in the querystring and then in the load event of the page just check the querystring value if it is present then get the newly inserted data and display it. Hope it will serve the purpose.
Best Regards, Apurva Kaushal
-
i have a button that is contain the code that call the stored procedure . the stored procedure is execute insert sql statment and add record to the data base that is in sql server . when i pressed the button the record is added well and go to the database. the problem is when i click refresh for the browser on this page the record is added again on the database . why & how can solve this problem ?
dead