JavaScript to set ASyncPostBackTrigger in .NET


/ Published in: JavaScript
Save to your folder(s)

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.


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.