Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jun 28, 2012 02:07 PM by kman0912
Jun 28, 2012 01:57 PM|LINK
I have an MVC 3 application containing a view with several html helper controls on it. For simplicity, assume there is a single textbox and and list control. The list control has an edit action link below it. The user clicks the link and is directed to
a different veiw where they can select from a list of options. After they select their options they are brought back to the original view page containing the textbox and the list control.
The problem I have is maintaining the data the user may have added to the textbox between the movement from the first view to the second view and back. If the user enters data in the textbox, clicks edit to select items in another view, then is directed
back to the original view, anything the user entered in the text box is lost.
What's the best way to preserve the user's data in this scenario without forcing a postback of the initial view?
Jun 28, 2012 02:03 PM|LINK
Hi You can keep the data in the Global JSON Array. At each redirection you have to save the data in the JSON array and when comback to the home page you have to assign the textbox value from the saved JSON array.
Session /Cookies/ TempData.
Jun 28, 2012 02:07 PM|LINK
Can you provide a simple example?