Q:

Best way to keep temp data for multiple AJAX requests within 1 page in ASP .NET MVC 3?

I have some really complex ASP .NET MVC 3 page where I need to create multilevel hierarchy data.
(This data also includes download file names.)
Is there any best way to keep temp data for multiple AJAX requests in ASP .NET MVC 3 within 1 page?
Thank you!!!

A:

Here are a couple of options:
1- use Session storage
2- Use TempData.Peek instead. This method reads the data but does not mark it for deletion

A:

Without more details you're looking at
1) MVC Session Object - a solid solution, but keep an eye object size
2) A hidden control (e.g. textbox/textarea) - easy to implement but may not be practical depending on the structure/type of data you're dealing with
3) JQuery Cache - easy and all client side

