Determine how an ASP.NET Web page was invoked
Examine the values of the following Page class properties, and then refer the table to determine how the page was invoked:
-
IsPostBack
-
PreviousPage
-
IsCrossPagePostBack
-
IsCallback
The following table lists ways in which a page can be invoked and the corresponding Page property values.
Invocation method
|
Property values
|
Original request
|
-
IsPostBack is set to false.
-
PreviousPage is set to null (Nothing in Visual Basic).
-
IsCallback is set to false.
|
Postback
|
-
IsPostBack is set to true.
-
PreviousPage is set to null (Nothing in Visual Basic).
-
IsCallback is set to false.
|
Cross-page posting
|
-
IsPostBack is set to false.
-
PreviousPage references the source page.
-
IsCrossPagePostBack is set to true.
-
IsCallback is set to false.
|
Server transfer
|
-
IsPostBack is set to false.
-
PreviousPage references the source page.
-
IsCrossPagePostBack that is referenced in the PreviousPage is set to false.
-
IsCallback is set to false.
|
Callback
|
-
IsPostBack is set to false.
-
PreviousPage is set to null (Nothing in Visual Basic).
-
IsCallback is set to true.
|
Like this:
Like Loading...
Related
It is often useful to know how an ASP.NET Website was invoked: whether by an unique ask for (an HTTP GET), a postback (an HTTP POST), a cross-page publish from another web page (an HTTP POST), or a exchange from another web page using the Transfer technique or using a callback from the web browser.
Hi Julie…Thanks for your feedback. Please mail us on contactus@alltechnicalfaqs.com on topics you want us to cover