简体   繁体   English

JavaScript在更新面板中无法正常工作

[英]JavaScript not functioning within Update Panel

why java script not work within update panel, i need add update panel to content place holder in site master in asp.net web form..but all Java script stops functioning in all other pages, is there any solution for this? 为什么Java脚本无法在更新面板中工作,我需要以asp.net Web形式将更新面板添加到站点主站点中的内容占位符。

 <asp:UpdatePanel ID="updater" runat="server">
          <ContentTemplate>
                <asp:ContentPlaceHolder runat="server" ID="MainContent" />
          </ContentTemplate>
 </asp:UpdatePanel>

Add this in your page, it should solve 将其添加到您的页面中,它应该可以解决

    <asp:Content ID="Content2" ContentPlaceHolderID="section2" runat="server">
    <script type="text/javascript">
      Sys.Application.add_load(JavascriptFunctionName);
    </script>
   </asp:Content>

Note : if you are calling the same function on page load you can remove 注意:如果要在页面加载时调用相同的函数,则可以删除

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM