State management techniques ASP .NET MVC 2
I am new to ASP.NET MVC and have worked in ASP.NET before. I am starting a new project in ASP.NET MVC 2 and wanted to find out what all state management techniques are available in ASP.NET MVC 2.
Can anyone please suggest s开发者_C百科ome good resource.
Thanks.
You can use Session
just as in ASP.NET WebForms. Was there anything else you wondered? You don't have ViewState as in WebForms, but you can use ViewData
to pass data between controllers and views (see e.g. http://msdn.microsoft.com/en-us/library/dd394711.aspx). What kind of state are you planning to manage?
For state management you can use Session
, but to do it the MVC way, you should combine it with action filters.
Here are some links that can help you:
- ASP.NET MVC Filters and Statefulness
- mvcConf 2 - Brad Wilson: Advanced MVC 3
精彩评论