I know it happens sometime before Load, but during what event exactly?
相关问题
- 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
- “Dynamic operations can only be performed in homog
- What is the best way to create a lock from a web a
- Add to htmlAttributes for custom ActionLink helper
You can see from the page life cycle as explained on MSDN
That the view state is loaded during the Load phase of the page lifecycle, i.e. the LoadViewState method of the "Page methods" and the
LoadViewState
method of the Control methods, above.The Viewstate is actually loaded in the OnPreLoad event of the page,Just after the Page_InitComplete.
I once got into this question too and got my answer from TRULY understanding Viewstate article, which I highly recommend.
After reading it I designed a graphic that helped me to understand better what was happening on between each stage and when and how ViewState was doing its job.
I'd like to share this graphic with other people that (like myself) need to see how stuff work in a more visual way. Hope it helps! :)
Click on the image to view at full width.
It's loaded into memory between init and load. See this article for a full break down of the page lifecycle.
That is to say, viewstate is loaded between the OnInit() and OnLoad() events of the page.
My favorite article on dealing with viewstate, which answers every question I have every time: http://weblogs.asp.net/infinitiesloop/archive/2006/08/03/Truly-Understanding-Viewstate.aspx
The viewstate is actually loaded between initComplete and Preload events.Check this for details http://msdn.microsoft.com/en-us/library/ms178472.aspx