I have a question about using session, or maybe TempData to store data while working on one page. I store and retrieve data using multiple Ajax requests and I save to session on my controller Action. What I’d like to do is, when user leaves my page, I’d like to clear session variables. How would I do that with session? Or maybe there is some kind of other way to store data only for one http request (I am not sure about this because as I said I have multiple POST as well as GET requests within the page.)
Any help would be appreciated. Thanks
You dont you make use of
Hiddenfieldsin your html to hold that data…Same as Asp.Net using hiddenfield to store the viewstate data…..