In asp.net pages, during postback, ViewState makes the data persistent. What makes the data persistent in ASP.net MVC?
相关问题
- Carriage Return (ASCII chr 13) is missing from tex
- How to store image outside of the website's ro
- 'System.Threading.ThreadAbortException' in
- Request.PathInfo issues and XSS attacks
- How to dynamically load partial view Via jquery aj
相关文章
- asp.net HiddenField控件扩展问题
- asp.net HiddenField控件扩展问题
- Asp.Net网站无法写入错误日志,测试站点可以,正是站点不行
- asp.net mvc 重定向到vue hash字符串丢失
- FormsAuthenticationTicket expires too soon
- MVC CDN fallback for Style Bundle
- “Dynamic operations can only be performed in homog
- What is the best way to create a lock from a web a
The MVC tries to apply the concept of Http protocol statelessness!! So there should be no viewstate equivalent to that of the asp web forms.
However in single page application, aka SPA : you use java script library on client to manage the page and contact the server using Ajax! So it gives the impression. That the viewstate is maintained
In Asp.Net we have Runat="Server" to make controls like Textbox,Checkbox... into asp.net controls which they run at server and they can maintain viewstate because of they are server controls.
Http is Stateless:
Http is stateless i.e; for it forgets the controls value (like Textbox,Checkbox) for every request that means it doesnt maintain state.To make stateful we use state management techniques like ViewState,Querystring,Sessions,Cookies in Asp.Net.
Coming to your Question
In MVC we dont have Viewstate.In order to maintain the values refer below link
Maintaining viewstate in Asp.net mvc?
ASP.NET MVC doesn't work with ViewState and Postback?
we use ViewBag,ViewData,TempData for the flow of values from controller to view or controller to controller .