Trying to learn something new every day!
C#
Handling ASP.NET PostBacks with URL Rewriting
2675 days
Today a co-worker crossed with an strange error (Validation of viewstate MAC failed…) when posting a contacts form. Strangely the error only happened when using the re-written url off the contacts page (contacts/), calling contacts.aspx worked flawlessly all times.
Is IsPostBack confusing? No way…
0Last year I’ve posted a reply on the ASP.NET Forums that tries to clarify the most common error and misunderstanding about postbacks and in particular related with the page life cycle.
Page life cycle have several things to consider and the behavior must be understood for the several possible scenarios: regular aspx pages, master pages, using ajax, user controls (acsx) inside regular aspx pages, etc. Read more about page live cycle here.


