开发者

State management techniques ASP .NET MVC 2

开发者 https://www.devze.com 2023-03-26 21:01 出处:网络
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.

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 ViewDatato 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
0

精彩评论

暂无评论...
验证码 换一张
取 消