title: How to get Id update panel that initial a request in javascript
body: <p>I want to know  Id update panel that initial a request in JavaScript .I write this script but it return <code>undefined</code>.</p>
  
  <pre><code>var prm = Sys.WebForms.PageRequestManager.getInstance();
  prm.add_initializeRequest(InitializeRequest);
  prm.add_endRequest(EndRequest);
  
  function InitializeRequest(sender, args) {
      alert(sender.ID);
  }
  function EndRequest(sender, args) {
  }
  </code></pre>
  
  <p><code>sender</code> is not null and it return <code>[object]</code> but How I can get <code>ID</code>?</p>
  
  <hr>
  
  <p><strong>Edit 1)</strong></p>
  
  <p>I think when <code>UpdatePanel</code> be inside <code>MasterPage</code> it does not work.this is my code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function () {
          var prm = Sys.WebForms.PageRequestManager.getInstance();
          prm.add_initializeRequest(InitializeRequest);
          prm.add_endRequest(EndRequest);
  
  
          function InitializeRequest(sender, args) {
              var UpdPanelsIds = args.get_updatePanelsToUpdate();
              alert(UpdPanelsIds[0]);
          }
          function EndRequest(sender, args) {
              if ($('.AlarmLogo').val() == "3") {
                  alert('nima');
              }
          }
      });
  
  
  &lt;/script&gt;
  </code></pre>
  
  <p>and :</p>
  
  <pre><code>&lt;form runat="server"&gt;
  &lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt;
  &lt;/asp:ScriptManager&gt;
  &lt;asp:Timer ID="timer" Interval="4000" runat="server" OnTick="timer_Tick" /&gt;
  &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"&gt;
      &lt;ContentTemplate&gt;
          &lt;asp:Panel ID="pnlAlarm" runat="server" CssClass="pnlAlarm" ClientIDMode="Static"&gt;
              &lt;a href="#"&gt;
                  &lt;div id="Alarm"&gt;
                      &lt;asp:TextBox ID="lblContent" runat="server" Text="HHHEEELLLOOO" CssClass="AlarmLogo" ClientIDMode="Static"&gt;&lt;/asp:TextBox&gt;
                  &lt;/div&gt;
              &lt;/a&gt;
          &lt;/asp:Panel&gt;
      &lt;/ContentTemplate&gt;
      &lt;Triggers&gt;
          &lt;asp:AsyncPostBackTrigger ControlID="timer" /&gt;
      &lt;/Triggers&gt;
  &lt;/asp:UpdatePanel&gt;
      &lt;div class="main"&gt;
          &lt;asp:ContentPlaceHolder ID="MainContent" runat="server" /&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>and code behind:</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e) 
  {     
      if (!IsPostBack)     
      {         
          Session["nima"] = 1;    
      } 
  } 
  
  protected void timer_Tick(object sender, EventArgs e) 
  {    
  } 
  </code></pre>