Ajax – Why does the ASP.NET UpdatePanel caused full page postback

ajaxasp.netupdatepanel

I've searched through Google and Stack Overflow for this and I've come up empty.

I have an ASP.NET 3.5 web application running on IIS 6 and it's using an UpdatePanel. Whenever I click the control that's supposed to cause the async postback, I get a full page postback. Just to be sure, I copied the code from http://ajax.net-tutorials.com/controls/updatepanel-control/ into a new page in my application and it works fine. What have I missed?

<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="pnlAdd" runat="server">
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="btnRefreshCaptcha" EventName="Click" />
    </Triggers>
    <ContentTemplate>
        <asp:Literal ID="litTest" runat="server" />
        <asp:LinkButton ID="btnRefreshCaptcha" runat="server" 
            onclick="lbnRefreshCaptcha_Click" Text="Refresh code" />
    </ContentTemplate>
</asp:UpdatePanel>

Any help is appreciated. Thanks!

Best Answer

I'm just pasting my comment from above here. This is my first post on here, so I was unaware of the big "Answer" button. :-|

I figured it out thanks to a flash while sitting here on the couch with my wife. There's a validationsummary outside the panel with some requiredfieldvalidators. I didn't think it was relevant, so I didn't post it here -- but it was! It wasn't actually posting back the whole page, but it WAS trying to validate the empty textboxes. Solution: add CausesValidation="false" to the async postback trigger button. I feel equally relieved for figuring it out and dumb for having missed something so basic. Thanks!

Related Topic