简体   繁体   中英

How to stop UpdatePanel when i click link button from causing whole page postback

How to stop UpdatePanel when I click link button from causing whole page postback?

UpdatePanel code:

<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>

Set ChildrenAsTriggers="true" on your UpdatePanel control. closing tag for update panel should be

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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