0
votes

I am developing an application in asp.net 2.0. In one form i have a button, and on click which will insert data into database. now after inserting if i click bowser refresh button i am getting the following error.

Refresh detected Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Refresh detected

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): Refresh detected]
WebTemplate.Template.RefreshProtectModule.appl_AcquireRequestState(Object source, EventArgs e) +351
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

Thanks in advance..

2

2 Answers

0
votes

Hitting refresh is actually the same as clicking the button to insert data again. Your button click event should probably redirect the user to a new page.

0
votes

Apparently you're using something called "RefreshProtectModule" which does not allow refresh. On one hand that's good - otherwise your form would insert record into DB on every refresh. On the other - you have to handle the "Refresh detected" exception and handle it graciously.