views:

90

answers:

2

how can i programmatically restart page lifecycle? i do some stuff in controls events which affects these controls. to see changes i have to draw page again. how can i do it?

+1  A: 

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.

Joel Coehoorn
A: 

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)

waqasahmed