錯誤 7 型別 'System.Web.UI.UpdatePanel' 的值無法轉換成 'System.Web.UI.HtmlControls.HtmlTableRow'。 D:\e-Training\EmployeeQuery.aspx 128 <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                                  <ContentTemplate>
<tr>
<td style="height: 30px"></td>
<td bgColor="#F3F4F6" style="height: 30px" align="left">
                                                        &nbsp;
                                                        工廠名&nbsp;</td>
<td style="height: 30px">:</td>
<td align=left style="height: 30px">
                                                        <asp:DropDownList ID="DropDownList2" runat="server" Width="184px" AutoPostBack="True">
                                                        </asp:DropDownList></td>
</tr>
<tr>
<td style="height: 30px"></td>
<td bgColor="#F3F4F6" align="left" style="height: 30px">
                                                        &nbsp;
                                                        部門名</td>
<td style="height: 30px">:</td>
<td align=left style="height: 30px">
                                                        <asp:DropDownList ID="DropDownList3" runat="server" Width="184px">
                                                        </asp:DropDownList></td>
</tr>
 </ContentTemplate>
                                        </asp:UpdatePanel>

解决方案 »

  1.   


            <asp:LinkButton ID="LinkButton1" runat="server" OnClientClick="ChooseMethod()" 
                onclick="LinkButton1_Click">LinkButton</asp:LinkButton>
                
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                                      <ContentTemplate>
                                                      <table id="table1">
                                                    <tr>
                                                        <td style="height: 30px"></td>
                                                        <td bgColor="#F3F4F6" style="height: 30px" align="left">
                                                            &nbsp;
                                                            工廠名&nbsp;</td>
                                                        <td style="height: 30px">:</td>
                                                        <td align=left style="height: 30px">
                                                            <asp:DropDownList ID="DropDownList2" runat="server" Width="184px" AutoPostBack="True">
                                                            </asp:DropDownList></td>
                                                    </tr>
                                                    <tr>
                                                        <td style="height: 30px"></td>
                                                        <td bgColor="#F3F4F6" align="left" style="height: 30px">
                                                            &nbsp;
                                                            部門名</td>
                                                        <td style="height: 30px">:</td>
                                                        <td align=left style="height: 30px">
                                                            <asp:DropDownList ID="DropDownList3" runat="server" Width="184px">
                                                            </asp:DropDownList></td>
                                                    </tr>
                                                    </table>
                                                     </ContentTemplate>
                                            </asp:UpdatePanel>
    这样不知道对不对
      

  2.   

    UpdatePanel不能嵌套在table
    ---------
    可以,一定可以.估计是你有语法错误.我一直都是把UpdatePanel嵌套在table中的.楼主可以把签到工作放到设计界面去做而要放在源去做,这样就不会出现语法错误了.这与你这个,UpdatePanel应该放在table的td中.
    我写个简单点的.
    <table>
     <tr>
      <td>
       <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <table>
        ,,
        </table>
       </asp:UpdatePanel>
      </td>
     </tr>
    </table>这样套就没问题了.
      

  3.   

    不需要 <ContentTemplate>吗
      

  4.   

    晕,好像2楼是对的,你把更新控件嵌套到表格中,楼主你放错位置了,表格只有(td)也就是单元格中才可以放其他控件的,你放在table下面肯定是不行的撒
      

  5.   

    <table>
    <tr>
      <td>只有这中间才可以加入新的东西或者别的什么控件</td>
    </tr>
    </table>table和tr之间是不能加其他的东西的,只有单元格里面才可以加
      

  6.   

    lz那样放什么控件都不行,只有放在td中,在TD中放其他控件