0

我在页面中间使用 UpdatePanel 控件进行地址类型单选按钮更改的部分回发。一切正常,但我正在努力解决对齐问题。UpdatePanel 内的控件与外部控件不对齐。我该如何解决这个问题?请告诉我。

<table id="tblEdit" class="cssclass1" cellpadding="3" runat="server">

    <tr>
        <td class="cssclass1" align="right">
            Title
        </td>
        <td>
            <telerik:RadTextBox ID="textbox1" runat="server" Width="280px" ReadOnly="true"
                BackColor="LightGray" />
        </td>
         <td align="right">
            <asp:Label CssClass="cssclass1" ID="LblFirstName" runat="server">First Name</asp:Label>
        </td>
        <td align="left">
            <telerik:RadTextBox ID="txtFirstName" runat="server" MaxLength="30">
            </telerik:RadTextBox>
            <asp:Image ID="Image1" ImageUrl="../../../images/requiredfield.gif" AlternateText="Required Field"
                runat="server"></asp:Image><asp:HiddenField ID="hfCaseEntityId" runat="server" />
        </td>
    </tr>
<tr>
<td colspan="4">

 <asp:UpdatePanel ID="UpdatePanel1" runat="server">
   <ContentTemplate>

    <tr>
        <td class="cssclass1" align="right">
            Address Type 
        </td>
        <td align="left">
            <asp:RadioButtonList ID="AddressType" runat="server" RepeatDirection="Horizontal" OnSelectedIndexChanged="AddressType_SelectedIndexChanged" AutoPostBack="true"  >
                <asp:ListItem Value="1" Selected="True">Home</asp:ListItem>
                <asp:ListItem Value="2">Work</asp:ListItem>
            </asp:RadioButtonList>
        </td>
        <td class="cssclass1" align="right">
        </td>
        <td align="left">
        </td>
    </tr>
    <tr>
        <td align="right">
            <asp:Label CssClass="cssclass1" ID="LblHomeStreet1" runat="server">Address</asp:Label>
        </td>

        <td align="left">
            <telerik:RadTextBox ID="txtHomeStreet1" runat="server" MaxLength="40" >
            </telerik:RadTextBox>
            <asp:Image ID="Image10" ImageUrl="../../../images/requiredfield.gif" AlternateText="Required Field"
                runat="server"></asp:Image>
        </td>
        <td align="right">
            <asp:Label CssClass="cssclass1" ID="LblHomeStreet2" runat="server">Street 2</asp:Label>
        </td>
        <td align="left">
             <telerik:RadTextBox ID="txtHomeStreet2" runat="server" MaxLength="40" Width="280px">
            </telerik:RadTextBox>
        </td>
    </tr>
    <tr>
        <td align="right">
            <asp:Label CssClass="cssclass1" ID="LblHomeCity" runat="server">City</asp:Label>
        </td>
        <td align="left">
            <telerik:RadTextBox ID="txtHomeCity" runat="server" MaxLength="30">
            </telerik:RadTextBox>
        </td>
        <td align="right">
            <asp:Label CssClass="cssclass1" ID="LblHomeState" runat="server">State</asp:Label>
        </td>
        <td align="left">
 <telerik:RadTextBox ID="txtHomeState" runat="server" MaxLength="30">
            </telerik:RadTextBox>
        </td>
    </tr>
      </ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
4

1 回答 1

0

您的 HTML 无效。您的第一行<ContentTemplate>是 a <tr>,但是,您似乎正试图在其中包含另一行<table>。您可能想查看内表上的 cellpading=0 和 cellspacing=0 。此外,您可以将 CSSClass 添加到 UpdatePanel 以进行任何其他格式化。

于 2012-07-13T14:27:07.380 回答