Sys.WebForms.PageRequestManager isInAsyncPostBack Property

Returns a value that indicates whether the PageRequestManager object is processing a postback.

Note Note

To get or set property values for client API properties, you must call property accessor methods that are named with the get_ and set_ prefixes. For example, to get or set a value for a property such as cancel, you call the get_cancel or set_cancel methods.

var status = Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack();

You can use the isInAsyncPostBack property to define how the PageRequestManager class behaves when a user submits a postback multiple times on a page.

The following example shows how to determine whether the PageRequestManager is currently processing a postback.

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 

<script runat="server">
    Protected Property LastUpdate() As DateTime
            If ViewState("LastUpdate") = Nothing Then
                Return DateTime.Now
            Else : Return (ViewState("LastUpdate"))
            End If
        End Get
        Set(ByVal Value As DateTime)
            ViewState("LastUpdate") = Value
        End Set
    End Property

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        If Not IsPostBack Then
            LastUpdate = DateTime.Now
        End If
    End Sub

    Protected Sub SlowProcessClick_Handler(ByVal sender As Object, ByVal e As System.EventArgs)
        LastUpdate = DateTime.Now
    End Sub

    Protected Sub FastProcessClick_Handler(ByVal sender As Object, ByVal e As System.EventArgs)
        LastUpdate = DateTime.Now
    End Sub


<html xmlns="">
<head runat="server">
    <title>PageRequestManager get_inPostBack Example</title>
    <style type="text/css">
    body {
        font-family: Tahoma;
      background-color: #FFC080;
      top: 95%;
      left: 1%;
      height: 20px;
      width: 270px;
      position: absolute;
      visibility: hidden;
    <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server" />

            <script type="text/javascript" language="javascript">


            function CheckStatus(sender, arg)
              var prm = Sys.WebForms.PageRequestManager.getInstance();
              if (prm.get_isInAsyncPostBack()) {
                 setTimeout("ChangeAlertDivVisibility('hidden')", 1000);
            function ChangeAlertDivVisibility(visstring)
                 var adiv = $get('AlertDiv');
        = visstring;

            <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="Server" >
                    <asp:Panel ID="Panel1" runat="server" GroupingText="Update Panel">
                        Last update:
                        <%= LastUpdate.ToString() %>
                        <br />
                        <asp:Button ID="Button1" 
                                    Text="Submit for Slow Process"
                                    runat="server" />
                        <asp:Button ID="Button2" 
                                    Text="Submit for Fast Process"
                                    runat="server" />
                        <br />
            <asp:Panel ID="AlertDiv" 
                       runat="server" >
                still processing previous request...