Quantcast
Channel: Powertips » ASP.Net
Viewing all articles
Browse latest Browse all 10

How to determine if the request is partial or full postback in asp.net

$
0
0


Sometimes, it is necessary to know if the page was requested through AJAX (partial) or full postback.

To determine which types of request has been made, you have to access the “ScriptManager”, to do this,

protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack)
{
if (ScriptManager.GetCurrent(this.Page).IsInAsyncPostBack)
{
// partial (asynchronous) postback occured
// insert Ajax custom logic here
}
else
{
// regular full page postback occured
// custom logic accordingly
}
}
}


Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles





Latest Images