title: Avoid Javascript Error while postback the page
body: <p>I'm using Telerik RAD Editor control in my ASP.NET 4.0 application which is in outside of any update pannel. In the same page i'm using couple of ModalPopUps &amp; update pannels to prevent unexpected full postback.
  There are couple of Pagemethods that invoked from Javascript function &amp; as well as couple of server side Button click events that are also invoked from javascript function.
  During process often Page throws the below Highlighted Javascript Error &amp; there after no javascript function proceed further or called any server side methods or events further &amp; program has been hanged. Once it's hosted in local server and this below defined error occurs then application will mulfunctioning with further javascript calls.</p>
  
  <p><strong>Error Message comes from  :</strong> </p>
  
  <pre><code>function Sys$WebForms$PageRequestManager$_endPostBack(error, executor, data) {
          if (this._request === executor.get_webRequest()) {
              this._processingRequest = false;
              this._additionalInput = null;
              this._request = null;
          }
          var handler = this._get_eventHandlerList().getHandler("endRequest");
          var errorHandled = false;
          if (handler) {
              var eventArgs = new Sys.WebForms.EndRequestEventArgs(error, data ? data.dataItems : {}, executor);
              handler(this, eventArgs);
              errorHandled = eventArgs.get_errorHandled();
          }
          if (error &amp;&amp; !errorHandled) {
              **throw error;**
          }
      }
  </code></pre>
  
  <p><strong>The Above marked area throws the error.</strong></p>
  
  <p>I have tried with below defined ways but not yet able to finalize the same that is either to stop to reflecting this Error or to skip this error so that it doesn't make any effects that prvent the normal process cycle of application.</p>
  
  <p><strong>Tried Solution 1.</strong>
  First , i had tried to register the controls lies under update pannel &amp; perform any server side event in page load.</p>
  
  <p><strong>ScriptManager ScrMgr = new ScriptManager();
          ScrMgr.RegisterAsyncPostBackControl(this.LstBoxXSD);</strong></p>
  
  <p><strong>Tried Solution 2.</strong>
  Secondly, i have tried to bind controls with their Asychronous trigger within update pannel.</p>
  
  <pre><code>**&lt;asp:AsyncPostBackTrigger ControlID="LstBoxXSD" EventName="SelectedIndexChanged"/&gt;**
  </code></pre>
  
  <p><strong>Tried Solution 3.</strong>
  Nextly, There is a Need to use KeyDown Event of 3rd Party Editor control from jquery and i had hooked the IFrame within that Editor control with "KeyDown" Event but once update pannel performs any asynchronous postback it unhooked that bind , so i had done the below code in JQuery to maintaining hooked binding between  Iframe within the Editor &amp; it's KeyDown event.</p>
  
  <pre><code>**&lt;script language="javascript" type="text/javascript"&gt;
      Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
      function EndRequestHandler(sender, args) {
          $(document).ready(function () {
              $(function () {
                  $('#3rdPartyControl_contentIframe').contents().find("body").bind("keydown", function (e) {
                      e = e || window.event; // because of Internet Explorer quirks... 
                      var code = e.which || e.charCode || e.keyCode; ;
                      if (code == 49 &amp;&amp; !e.altKey &amp;&amp; !e.ctrlKey &amp;&amp; !e.shiftKey) {
                          // alert(code);
                      } else if (code == 65 &amp;&amp; e.altKey) {
                          //   alert(code);
                      }
                      else if (code == 83 &amp;&amp; e.altKey) {                       
                          SelectElement();
                      }
                      else if (code == 80 &amp;&amp; e.altKey) {
                          if (String($find("3rdPartyControl").getSelectionHtml().trim()).length &gt; 0) {
                              RemoveParentElem();
                          }
                      }
                      else if (code == 82 &amp;&amp; e.altKey) {
                          if (String($find("3rdPartyControl").getSelectionHtml().trim()).length &gt; 0) {
                              RemoveElem();
                          }
                      }
                      else {
                      }
                  });
              });
          });
      }
  &lt;/script&gt;**
  </code></pre>
  
  <p>And important is that i had done the above JQuery code after Body Tag.
  Please help me out with a possible solution from the aforesaid issue where i can either able to stop generating this error or to bypass the error anyhow. as it's completely postponed the project finishing.</p>