Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 17, 2012 03:43 AM by ignatandrei
Apr 16, 2012 09:24 AM|LINK
I have a search screen. User will search based on search fields and clicks find button. Jqgrid will be populated. In Jqgrid i have Edit link which navigates to another view. In that view, there is a back button. If user clicks on back button, it should goto
previous page and must select the fields those are searched before and Jqgrid must be populated. controller is same for two views. My question is how to select fields on search screen for the next httppost.[we can use session, but i think it is not proper
Pl reply me if anybody find answer.
Apr 16, 2012 09:32 AM|LINK
I think you can use TempData. TempData is used to maintain the value between two postbacks. TempData is a very short-lived instance.
Apr 16, 2012 09:35 AM|LINK
Is TempData value available for next postback?
E. Umamaheswar Reddy
Apr 16, 2012 09:51 AM|LINK
Yes. I hope, You can use it for next postback.
Apr 16, 2012 10:41 AM|LINK
Yes, it is working. But TempData internally uses session as backing store. Can't we do it otherthan Tempdata and session?
E. Umamaheswara Reddy
Apr 16, 2012 12:31 PM|LINK
But TempData will ot hold the values throughout application. That life time is max two postback.
So performancewise TempData is good when compare to Session.
Apr 16, 2012 03:33 PM|LINK
If you don't want TempData to use session then you can override GetTempDataProvider in the controller and implement your own ITempDataProvider and store and load it from anyplace you want.
Apr 17, 2012 03:42 AM|LINK
TempData will ot hold the values throughout application. That life time is max two postback.
TempData is good when compare to Session.
TempData is based on Session. So it's the same. If you do not want Session, search for TempDataProvider cookies.
Apr 17, 2012 03:43 AM|LINK
we can use session, but i think it is not proper coding style
How to maintain data for different views