<asp:UpdatePanel > doesn't work inside a table <tr>?

ajax, asp.net, c#

Solution

UpdatePanel needs to render a div or span in order to function correctly. Since neither of these elements can be rendered between table rows, UpdatePanel does not have a placeholder to render the postback response html, and thus it doesn't work.

A workaround in your case may be to see which part of your page does not need to be inside the update panel and leave it outside. You could leave just the contents of `<td colspan="2">` inside the UpdatePanel.

Problem

I have a problem getting an `<asp:UpdatePanel..>` to work inside a `<table>.. <tr> </tr>` structure and I don't know why. When the UpdatePanel is commented out everything works fine, but when I un-comment the UpdatePanel the contents of the `<tr> </tr>` tag doesn't even show up in Visual Studio 2010. This content does display when I run the web page but the UpdatePanel doesn't work. Non of my other web pages in this project have this problem but, then again, I use `<div>`s instead of `<table`>s in them. One other thing. The is in my MasterPage. Here is my script: ``` <asp:UpdatePanel ID="W9UpdatePanel" runat="server" UpdateMode="Always"> <ContentTemplate> <tr> <td colspan="6"> <div class="branchSetupSectionTitle">W-9 Information:</div> </td> </tr> <tr> <td colspan="2"> <asp:Button ID="btnDownloadW9Pdf" runat="server" Text="Download W-9" onclick="btnDownloadW9Pdf_Click" AutoPostBack="True" /> <%--<asp:RegularExpressionValidator ID="RegularExpressionValidator24" runat="server" ControlToValidate="txtFirstPaymentAmount" Display="Dynamic" ErrorMessage="The dollar amount you entered is in the wrong format." ForeColor="Red" ValidationExpression="^\d+(\.\d\d)?$">*</asp:RegularExpressionValidator>--%> <asp:CheckBox ID="chkW9FormSubmitted" runat="server" AutoPostBack="True" oncheckedchanged="chkW9FormSubmitted_CheckedChanged" Text=" I have submitted this W-9 Form" /> </td> <td></td> <td></td> <td></td> <td></td> </tr> </ContentTemplate> </asp:UpdatePanel> </tr> ``` The event fires for both the button and the checkbox but the entire page is refreshed. Thanks for your help.

Original source