0

Hi
I have a peculiar problem. I created an ASP.Net page with the code behind in C#. After submitting I am storing the primary key value of the row inserted in a ViewState variable. Then I pass this as a query string and do a Response.Redirect() to another page. Then I use the browser back button to come back to the previous page. I click submit again. In the submit routine I am unable the get the same value I stored earlier in the Viewstate variable for the page. My aim is this. To prevent submitting again when clicking the submit button. For this I need to store the primary key to check whether it exists in the database after navigating by the back button. Can you help?

Thanks

2
Contributors
2
Replies
3
Views
12 Years
Discussion Span
Last Post by Jayakumar R
0

ViewState can be very tricky. Try using a Session state variable for this, or, the tried-and-true method of writing a cookie instead.

0

Hi
Thanks for your feedback. I was curious whether ASP.Net has any other way of handling this issue I did not know. I will try with session or cookie. Thanks once again

Jayakumar

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.