Documentation for: ASP.NET Ajax Version 1.0

This documentation is for a previous version. For the current released version, see the ASP.NET Ajax documentation on MSDN.








Sys.WebForms.InitializeRequestEventArgs Class

Used by the initializeRequest event of the Sys.WebForms.PageRequestManager class to pass argument information to event handlers.

Namespace: Sys.WebForms

Inherits: Sys.CancelEventArgs


new Sys.WebForms.InitializeRequestEventArgs();




InitializeRequestEventArgs Constructor

Initializes a new instance of the InitializeRequestEventArgs class.




postBackElement Property

Gets the postback element that initiated the asynchronous postback.

request Property

Gets the request object that represents the current postback.


This class contains private members that support the client-script infrastructure and are not intended to be used directly from your code. Names of private members begin with an underscore ( _ ).


Event handlers can use the request property to access the request object, and the postBackElement property to determine which element caused the postback.

The initializeRequest event of the PageRequestManager class is raised before processing of the asynchronous request starts.


The following example shows how to use the initializeRequest event to allow an asynchronous postback to be canceled. Script in the initializeRequest event handler determines whether an asynchronous postback is currently in progress by using the isInAsyncPostBack property of the PageRequestManager class. If a postback is in progress, the postBackElement property is used to determine the ID of the element that caused the postback. If the ID matches the ID of a button that cancels the postback, the abortPostBack method of the PageRequestManager class is called. Otherwise, the current request is canceled by using the cancel property of the CancelEventArgs class.