How to maintain form state after Post-Redirect-Get in ASP.net?

Posted by Ian Boyd on Stack Overflow See other posts from Stack Overflow or by Ian Boyd
Published on 2012-06-27T14:55:24Z Indexed on 2012/06/27 15:16 UTC
Read the original article Hit count: 227

Filed under:
|

Imagine a page with a form input:

Search Criteria: crackers                  


From: [email protected]          
To: [email protected]      
Subject: How to maintain form state with PRG?
Message: Imagine a page with form input:              
 
 
 
 
 

Send

After the user clicks Send, the server will instruct to client to Redirect, as part of the Post-Redirect-Get pattern.

POST /mail/u/compose

HTTP/1.1 303 See Other
Location: http://stackoverflow.com/mail/u/compose

And the client will issue a GET of the new page. The problem is that some elements of the existing form are lost:

Search Criteria:                   

It gets worse when there are a few drop-downs, and checkboxes.

How can i maintain form state in using Post-Redirect-Get in ASP.net, given that the viewstate is then non-existent.


Bonus Reading

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about post-redirect-get