ASP.NET

HttpModule event execution order for multiple modules

I did some tests to find out the event execution order for multiple HttpMoudles in ASP.NET. Here is the what I found:When there are multiple HttpMoudles, and the modules are registered in Web.config, all event handlers are executed in the SAME order in which they were registered, except PreSendRequestHeaders and PreSendRequestContent which are in REVERSE order.Here is an example, suppose we have 3 modules registered in Web.config in following order. <modules> <add name="Module1" /> <add ......

Posted On Monday, October 17, 2016 11:06 AM | Comments (6)

Restore ViewState data with ViewStateModeById

In my last post ViewState and Dynamic Control, I mentioned that ViewStateModeByIdAttribute can be used to change the default behavior of how ASP.NET finds the controls when ViewState data restored. Now, let's have a look how it can be done. For now, let's forget about ViewStateModeByIdAttribute for a second, and just have a simple page as following: Default.aspx <body> <form id="form1" runat="server"> <asp:Panel ID="pnlMain" runat="Server"> </asp:Panel> </form> </body> ......

Posted On Monday, February 19, 2007 10:18 PM | Comments (2)

ViewState and Dynamic Control

I thought I understand ViewState, until I came cross this exception: Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request. This is a question asked by someone on a .NET mailing list. My first guess of what causing the ......

Posted On Saturday, February 17, 2007 8:31 AM | Comments (40)

Copyright © Changhong Fu

Design by Bartosz Brzezinski

Design by Phil Haack Based On A Design By Bartosz Brzezinski