开发者

Buttons not firing of async postback in update panel

开发者 https://www.devze.com 2023-04-13 07:07 出处:网络
I have a problem with buttons firing a full postback in a updatepanel, and i just cannot figure out why.

I have a problem with buttons firing a full postback in a updatepanel, and i just cannot figure out why.

    <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
    <div class="VidVote">
    <ul class='star-rating'>
        <asp:Panel ID="CurrRate" runat="server"></asp:Panel>
        <li><asp:Button ID="OneCati" CssClass="one-star" runat="server" 
            onclick="OneCati_Click" CausesValidation="False" /></li>
        <li><asp:Button ID="TwoCati" CssClass="two-stars" runat="server" 
            onclick="TwoCati_Click" CausesValidation="False" /></li>
        <li><asp:Button ID="ThreeCati" CssClass="three-stars" runat="server" 
            onclick="ThreeCati_Click" CausesValidation="False" /></li>
        <li><asp:Button ID="FourCati" CssClass="four-stars" runat="server" 
            onclick="FourCati_Click" CausesValidation="False" /></li>
        <li><asp:Button ID="FiveCati" CssClass="five-stars" runat="server" 
            onclick="FiveCati_Click" CausesValidation="False" /></li>
    </ul>
    </div>
</ContentTemplate>
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="OneCati" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="TwoCati" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="ThreeCati" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="FourCati" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="FiveCati" EventName="Click" />
    </Triggers>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
    <div class="VidScore">
    <h3 style='text-align:center;margin-bottom:0; font-size:40px;'>
        <asp:Label ID="Score" runat="server" Text="Label"></asp:Label>
    </h3>
    </di开发者_高级运维v>
</ContentTemplate>
</asp:UpdatePanel>

i have tried with every combination of panels i can think of and without asp:AsyncPostBackTrigger

noticed http://finalfantasyworld.net/dev/Movie/ Works http://dev.finalfantasyworld.net/Movie/ don't work

see the problem in action http://dev.finalfantasyworld.net/Movie/ try the rating


Have you tried doing something like this?:

<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional" RenderMode="Inline"> 
    <Triggers> 
        <asp:AsyncPostBackTrigger ControlID="OneCati" EventName="Click" /> 
        <asp:AsyncPostBackTrigger ControlID="TwoCati" EventName="Click" /> 
        <asp:AsyncPostBackTrigger ControlID="ThreeCati" EventName="Click" /> 
        <asp:AsyncPostBackTrigger ControlID="FourCati" EventName="Click" /> 
        <asp:AsyncPostBackTrigger ControlID="FiveCati" EventName="Click" /> 
    </Triggers>
    <ContentTemplate> 
        <div class="VidVote"> 
        <ul class='star-rating'> 
            <asp:Panel ID="CurrRate" runat="server"></asp:Panel> 
            <li><asp:Button ID="OneCati" CssClass="one-star" runat="server"  
                onclick="OneCati_Click" CausesValidation="False" /></li> 
            <li><asp:Button ID="TwoCati" CssClass="two-stars" runat="server"  
                onclick="TwoCati_Click" CausesValidation="False" /></li> 
            <li><asp:Button ID="ThreeCati" CssClass="three-stars" runat="server"  
                onclick="ThreeCati_Click" CausesValidation="False" /></li> 
            <li><asp:Button ID="FourCati" CssClass="four-stars" runat="server"  
                onclick="FourCati_Click" CausesValidation="False" /></li> 
            <li><asp:Button ID="FiveCati" CssClass="five-stars" runat="server"  
                onclick="FiveCati_Click" CausesValidation="False" /></li> 
        </ul> 
        </div> 
        <div class="VidScore"> 
            <h3 style='text-align:center;margin-bottom:0; font-size:40px;'> 
                <asp:Label ID="Score" runat="server" Text="Label"></asp:Label> 
            </h3> 
        </div> 
    </ContentTemplate> 
</asp:UpdatePanel> 


Just put your async triggers in updatepanel2 and remove updatepanel1 and put that all button outside of update panel, only your lable section should be in updatepanle2. let me know your result..

0

精彩评论

暂无评论...
验证码 换一张
取 消