Click here to Skip to main content
13,046,281 members (120,279 online)
Rate this:
Please Sign up or sign in to vote.
i have a search request on a view with a find button. when the button clicked i have its response in Json, and a submit button on the same view.So the search request its json response and a submit on the same view,now when i click the submit button it goes to another view of different controller,and in that view i have a back button which has to come back to my search page, where it should show the search and the json response. For this i need to store the search request and the json response coming..i have the json response in javascripts. So how do i store the search request and the json response in-order to show the request and response when i click the back button. using MVC3 razor
Posted 15-Oct-12 6:47am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You are perfectly right in your question title: session is one option, cookie is an other. But it depends on what you have done with your "json response". Let's suppose it is a simple text value.
When handle the search ajax action, store the result in the session. When you render that view, use the session value to restore the result. With cookie you do quite the same, just with javascript and on client side.
If the result is more complex, you have to decide how to store it efficiently...
Member 9359591 15-Oct-12 13:31pm
actually i'm new to this and i dont know how to store the session. can i know whats the code to store that session
Zoltán Zörgő 15-Oct-12 13:49pm
It is quite the same, as with classic. See:
Member 9359591 16-Oct-12 14:00pm
thank you Zoltan Zorgo

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 15 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100