question about asp.net lifecycle
how can i programmatically restart page lifecycle? i do some stuff in controls events which affects these controls. to see ch开发者_运维技巧anges i have to draw page again. how can i do it?
The page will be "re-drawn" near the end of the page lifecycle, during the Render phase. Remember that immediately after this happens, this instance of your page is destroyed. That is the nature of the web. The page lifecycle will re-start when the user triggers a postback in their browser. At this point, a brand new instance of your page class is created. This new instance will strongly resemble the previous instance, but it's still a completely different instance of the class. This is how ASP.Net works.
You can do something like this:
Response.Redirect(HttpContext.Current.Request.Url.AbsolutePath);
but you may lose your drawing if you don't save it somewhere on server or client (e.g. cookie)
精彩评论