Current Request Type Property is a way to identify current request is post back request or not.
Current context request object have property named RequestType which can be checked to know that is the page posted back to server or not. For example :-
if (Request.RequestType == "GET")
{
// Call when page loading first time
// Equal to if (!IsPostBack) property
}
if (Request.RequestType == "POST")
{
// Call when page loading second or higher time
// Equal to if (IsPostBack) property
}
if (Request.RequestType == "GET")
{
// Call when page loading first time
// Equal to if (!IsPostBack) property
}
if (Request.RequestType == "POST")
{
// Call when page loading second or higher time
// Equal to if (IsPostBack) property
}
This is an alternate way of isPostBack mechanism.
GET :- When user requests to a web page by typing the URL in web browser, open a window through JavaScript (window.open ..) or clicking in hyperlink its called Get request or first time request.
POST :- When user requests to a web page by clicking in button (input type submit) or submit a form through JavaScript to the server (form.submit() function in JavaScript) its called Post request or second / higher request.
That’s it!!…..Happy Programming...