954,178 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Get submitted values when navigating back with browser back button

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

Jayakumar R
Newbie Poster
7 posts since Jan 2005
Reputation Points: 10
Solved Threads: 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.

tgreer
Made Her Cry
Team Colleague
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
 

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

Jayakumar R
Newbie Poster
7 posts since Jan 2005
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You