Refresh Button and View State
Dear All,
I have having a probelm with the refresh button of the browser. I
have an asp.net form which inserts records into a database.The record is successfully inserted. In the back button of the browser I have added the following code
Response.ExpiresAbsolute = DateAdd(DateInterval.Second, -1, Now)
Response.Expires = 0
Response.CacheControl = "no-cache"
Which gives me a warning message:
Warning: Page has Expired The page you requested was created using
information you submitted in a form. This page is no longer available. As a
security precaution, Internet Explorer does not automatically resubmit your
information for you.
To resubmit your information and view this Web page, click the Refresh button
I have happy with the message. But the problem is that when I press the refresh button.All the data which was sent to the database appears in all the controls. I know that It is impossible to avoid "refresh button" and the data is basically coming from the VIEWSTATE. I tried to disable viewstate
but no luck. I tried to do response.redirect to the same form. But still the data stands in the controls.
Is there some way.I can prevent data from being displayed in the controls
Any help much appreciated
Cheers,
Sunil Sabir
|