当我单击链接按钮导致整页回发时如何停止UpdatePanel

时间:2015-05-04 10:03:53

标签: c# asp.net ajax updatepanel

当我点击链接按钮导致整页回发时,如何停止UpdatePanel

UpdatePanel代码:

<asp:UpdatePanel ID="panel_update" runat="server" UpdateMode="Conditional">
  <ContentTemplate>  
    <asp:Label ID="comment_sub" runat="server" Text='<%#Eval("review_headline") %>/>

    <asp:Repeater ID="repeat" runat="server" OnItemDataBound="repeat_ItemDataBound" >
      <HeaderTemplate>
        <div class="top_review">
          <h3>TOP REVIEWS</h3>
          <a class="view_all">View all reviews(<%=top_view%>)</a>
        </div>
      </HeaderTemplate>
      <ItemTemplate>
        <asp:Label ID="lblSubject" runat="server" Text='<%#Eval("commented_by") %>' Font-Bold="true" /> 
  </ContentTemplate>
  <Triggers>
    <asp:AsyncPostBackTrigger ControlID ="link1" EventName="Click" />
    <asp:AsyncPostBackTrigger ControlID ="link2" EventName="Click" />
    <asp:AsyncPostBackTrigger ControlID ="link3" EventName="Click" />                                                    
  </Triggers>        
</asp:UpdatePanel>

1 个答案:

答案 0 :(得分:0)

设置ChildrenAsTriggers =&#34; true&#34;在您的UpdatePanel控件上。更新面板的结束标记应为