博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Ajax second postback not working in Sharepoint in UpdatePanel
阅读量:6045 次
发布时间:2019-06-20

本文共 1708 字,大约阅读时间需要 5 分钟。

We have one problem in work, we spend with that two days without any solution, all we found cause some another problem. This is what help us when the page is not making second postback in update panel when the first postback is fired by element in UpdatePanel and refresh only update panels on the page.

Taken from 

Windows SharePoint Services JavaScript has a “form onSubmit wrapper” which is used to override the default form action.  This work is put in place to ensure that certain types of URLs, which may contain double byte characters, will fully work across most postback and asynchronous callback scenarios.  However, if your scenarios do not involve double byte character URLs, you may successful disable this workaround and gain the ability to use ASP.NET AJAX UpdatePanels.

To do this, you may need to register a client startup script which disables this workaround, in addition to resetting the default form action:

  1. <script type='text/javascript'>  
  2.   _spOriginalFormAction = document.forms[0].action;  
  3.   _spSuppressFormOnSubmitWrapper=true;  
  4. </script>  

This script may be directly embedded in the page, or could be emitted by a control that uses the UpdatePanel. The following is an example of a very simple method which will fix this issue:

  1. private void EnsureUpdatePanelFixups()  
  2. {  
  3.   if (this.Page.Form != null)  
  4.   {<br />  
  5.     string formOnSubmitAtt = this.Page.Form.Attributes["onsubmit"];  
  6.     if (formOnSubmitAtt == "return _spFormOnSubmitWrapper();")  
  7.     {  
  8.       this.Page.Form.Attributes["onsubmit"] = "_spFormOnSubmitWrapper();";  
  9.     }  
  10.   }  
  11.   ScriptManager.RegisterStartupScript(thistypeof(AjaxUpdatePanelPart), "UpdatePanelFixup""_spOriginalFormAction = document.forms[0].action; _spSuppressFormOnSubmitWrapper=true;"true);  
  12. }  

转载地址:http://mejex.baihongyu.com/

你可能感兴趣的文章
在Oracle中删除所有强制性外键约束
查看>>
【R】R语言使用命令行参数 - [编程技巧(Program Skill)]
查看>>
经典算法题每日演练——第二题 五家共井
查看>>
存储过程中拼接的变量和点的问题
查看>>
ASP.NET那点不为人知的事(一)
查看>>
HTML 表格
查看>>
VMware 虚拟化编程(7) — VixDiskLib 虚拟磁盘库详解之三
查看>>
php 未实例化类调用方法的问题
查看>>
我对读计算机软件专业硕士的几点看法
查看>>
用JS写CSS
查看>>
TOJ4537: n阶行列式
查看>>
3.16
查看>>
表单文件上传与文件下载
查看>>
下午考
查看>>
创建字符设备的三种方法
查看>>
走在网页游戏开发的路上(六)
查看>>
nginx 配置的server_name参数(转)
查看>>
Uva592 Island of Logic
查看>>
C++基础代码--20余种数据结构和算法的实现
查看>>
footer固定在页面底部的实现方法总结
查看>>