tags:

views:

181

answers:

3

Hello,

I'm a super beginner ASP.NET developer. I read that on every submit the request parameters are being populated to the controls and instead of reading the "Response.Form[]" parameters I can read the input parameters from the control itself.

Are there any events that I can catch all the submits before and after the magic happens? Which method on the server side is activated that perform this magic? Can I override it (for fun)?

Thanks, Ronny

+2  A: 

I believe that you are talking about the function of Viewstate and how control values are persisted.

This is a diagram that will show you the page load order for ASP.NET

For you, if you want to look before viewstate is loaded, you can work inside the Page_Init method.

Mitchel Sellers
A: 

see few tutorials

http://aspalliance.com/quickstart/aspplus/

http://quickstart.developerfusion.co.uk/QuickStart/

In asp.net all event, result in post-back. So, you can handle them in Page_Load, but it's classic way. For fun you can try it.

Saar
A: 

ASP.NET maps HTML input field values from the Request.Form collection to server control properties, such as TextBox.Text between the Page.InitComplete and Page.PreLoad events, as detailed in the ever-linkable ASP.NET Page Life Cycle Overview.

The actual mapping takes place in the non-virtual private method Page.ProcessPostData, so there's no real hook for modifying that process. (You can see this by downloading Reflector and reviewing the Page.ProcessRequestMain method.)

If you want to perform custom processing before or after the mapping, you can add a handlers to the appropriate events or override the associated virtual methods (Page.OnInitComplete and Page.OnPreLoad).

Jeff Sternal