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
}
}
}