JavaScript to set ASyncPostBackTrigger in .NET

 / Published in: JavaScript

If you wish to set an ASyncPostBackTrigger in ScriptManager for AJAX.NET, using ASyncPostBackTrigger="xxx" causes Firefox, Chrome, Safari, etc. to timeout on partial page postback, using this javascript to set the ASyncPostBackTrigger (instead of the tag on the ScriptManager) will allow this to work.

  1. <script type="text/javascript">
  2. AjaxControlToolkit.ToolkitScriptManager ajax = (AjaxControlToolkit.ToolkitScriptManager)this.Page.Master.FindControl("ScriptManager1");
  3. if(ajax != null) ajax.AsyncPostBackTimeout = 600;
  4. </script>

Report this snippet  

You need to login to post a comment.