小编ice*_*ice的帖子

updatepanel 内的按钮导致整个页面刷新

我使用了两个UpdatePanel标签,一个有一个Svginside 并且我需要在单击按钮时刷新其内容,而该按钮在另一个UpdatePanel. 我只是意识到Page_Load每次单击按钮时都会执行代码隐藏中的函数。我UpdateMode="Conditional"已经设置了属性但没有帮助。知道为什么吗?以下是我的代码:

           <asp:ScriptManager ID="ScriptManager1" runat="server">
           </asp:ScriptManager>
           <asp:UpdatePanel runat="server" id="GlobalUpdatePanel" UpdateMode="Conditional">
              <Triggers>
                  <asp:AsyncPostBackTrigger controlid="ButtonPP" eventname="Click" />
              </Triggers>
              <ContentTemplate>
                  <svg width ="1024" height = "540"></svg>            
              </ContentTemplate>
           </asp:UpdatePanel>
           <asp:UpdatePanel ID="ControlUpdatePanel" runat="server" Visible="True" UpdateMode="Conditional">
              <ContentTemplate>      
                  <asp:Button id ="ButtonPP" runat="server" Text="Run PP"  OnClick="ButtonPP_Click" />
              </ContentTemplate>
           </asp:UpdatePanel> 
Run Code Online (Sandbox Code Playgroud)

提前致谢!

asp.net updatepanel buttonclick page-refresh

2
推荐指数
1
解决办法
2083
查看次数

标签 统计

asp.net ×1

buttonclick ×1

page-refresh ×1

updatepanel ×1