简体   繁体   中英

AJAX rating control inside update panel leads to reload the complete page

I have used AJAX Rating control for star rating. I am trying to achieve rating without page postback, therefore I placed inside update panel but still page is used to reload.

Below is aspx page code:

<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
     <cc2:Rating ID="Rating1" AutoPostBack="true" OnChanged="OnRatingChanged" runat="server"
  StarCssClass="Star" WaitingStarCssClass="WaitingStar" EmptyStarCssClass="Star"                                                              FilledStarCssClass="FilledStar">
      </cc2:Rating>
        <div style="text-align: left; padding-right: 2px;">
         <asp:Label ID="lblRatingStatus" runat="server" Text=""></asp:Label>
        </div>
     </ContentTemplate>
 </asp:UpdatePanel>

Change update mode of updatepanel from conditional to always and set ChildrenAsTriggers="True" . Should work in your case.

Let me know if it doesn't work.

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