0
我遇到了Visual Studio或ASP.NET的問題。我已經在html表格中佈置了控件,但TextBox和DropDownList控件在表格中顯示不正確,並且只是屏幕的底部。asp.net textboxes不合適
這裏的標記,你可以看到文本框「應該」是所有元素中:
<table>
<thead>
<tr>
<th colspan="6">
<asp:Label ID="Search_Header" runat="server" Font-Bold="True" meta:resourcekey="Search_HeaderResource1" Font-Size="16pt"></asp:Label>
</th>
</tr>
</thead>
<tbody class="controls">
<tr>
<td style="height: 22px">
<asp:Label ID="Destination" runat="server" meta:resourcekey="DestinationResource1" ></asp:Label>
</td>
<td style="height: 22px">
<asp:TextBox ID="Destination_Text" runat="server" meta:resourcekey="TextBox1Resource1"></asp:TextBox>
</td>
<td style="height: 22px">
<asp:Label ID="Check_In" runat="server" Text="Label" meta:resourcekey="Check_InResource1"></asp:Label>
</td>
<td style="height: 22px">
<asp:TextBox ID="Check_In_Date" runat="server" meta:resourcekey="Check_In_DateResource1" TextMode="DateTime" AutoPostBack="True"></asp:TextBox>
<ajaxToolkit:CalendarExtender ID="Check_In_Date_CalendarExtender" runat="server" TargetControlID="Check_In_Date" BehaviorID="Check_In_Date_CalendarExtender" />
</td>
<td style="height: 22px">
<asp:Label ID="Check_Out" runat="server" Text="Label" meta:resourcekey="Check_OutResource1"></asp:Label>
</td>
<td style="height: 22px">
<asp:TextBox ID="Check_Out_Date" runat="server" meta:resourcekey="Check_Out_DateResource1" TextMode="DateTime" AutoPostBack="True"></asp:TextBox>
<ajaxToolkit:CalendarExtender ID="Check_Out_Date_CalendarExtender" runat="server" TargetControlID="Check_Out_Date" BehaviorID="Check_Out_Date_CalendarExtender" />
</td>
</tr>
<tr style="margin-bottom: 5px">
<td></td>
<td>
<asp:RequiredFieldValidator ID="Destination_Validator" runat="server" ErrorMessage="<%$ Resources:Resource, Required_Field %>" ControlToValidate="Destination_Text" Font-Size="8pt" ForeColor="Red"></asp:RequiredFieldValidator>
</td>
<td></td>
<td>
<asp:RequiredFieldValidator ID="Check_In_Validator" runat="server" ErrorMessage="<%$ Resources:Resource, Required_Field %>" ControlToValidate="Check_In_Date" Font-Size="8pt" ForeColor="Red" ></asp:RequiredFieldValidator>
</td>
<td></td>
<td>
<asp:RequiredFieldValidator ID="Check_Out_Validator" runat="server" ErrorMessage="<%$ Resources:Resource, Required_Field %>" ControlToValidate="Check_Out_Date" Font-Size="8pt" ForeColor="Red" ></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Adults" runat="server" Text="Label" meta:resourcekey="AdultsResource1"></asp:Label>
</td>
<td>
<asp:TextBox ID="Adult_Count" runat="server" type="number" TextMode="Number" meta:resourcekey="Adult_CountResource1" ForeColor="Black" MaxLength="2" Width="20px" Font-Size="10pt" ReadOnly="True" ViewStateMode="Enabled"></asp:TextBox>
<ajaxToolkit:NumericUpDownExtender ID="Adult_Count_NumericUpDownExtender" runat="server" TargetControlID="Adult_Count" Minimum="1" Width="50" BehaviorID="Adult_Count_NumericUpDownExtender" Maximum="10" RefValues="" ServiceDownMethod="" ServiceDownPath="" ServiceUpMethod="" Tag="" TargetButtonDownID="" TargetButtonUpID="" ViewStateMode="Enabled" />
</td>
<td>
<asp:Label ID="Children" runat="server" Text="Label" meta:resourcekey="ChildrenResource1"></asp:Label>
</td>
<td>
<asp:TextBox ID="Child_Count" runat="server" type="number" TextMode="Number" meta:resourcekey="Child_CountResource1" ForeColor="Black" MaxLength="2" Width="20px" Font-Size="10pt" ReadOnly="True" ViewStateMode="Enabled"></asp:TextBox>
<ajaxToolkit:NumericUpDownExtender ID="Child_Count_NumericUpDownExtender" runat="server" TargetControlID="Child_Count" Minimum="0" Width="50" BehaviorID="Child_Count_NumericUpDownExtender" Maximum="10" RefValues="" ServiceDownMethod="" ServiceDownPath="" ServiceUpMethod="" Tag="Child" TargetButtonDownID="" TargetButtonUpID="" ViewStateMode="Enabled" />
</td>
<td>
<asp:Label ID="Room_Size" runat="server" Text="Label" meta:resourcekey="Room_SizeResource1"></asp:Label>
</td>
<td>
<asp:DropDownList ID="Room_Size_List" runat="server" meta:resourcekey="Room_Size_ListResource1">
<asp:ListItem meta:resourcekey="ListItemResource1">1 adult</asp:ListItem>
<asp:ListItem meta:resourcekey="ListItemResource2">2 adults</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
</tbody>
</table>
這是所有的頁面的CSS? – Ethilium
唯一相關的css是「控件」類,其中我將表設置爲相對位置,將其子設置爲絕對。仍然無法正常工作 – sl09
即使重新啓動計算機後問題仍然存在。哦,並且圖像中的「搜索」按鈕也應該位於表格下方(並且不是) – sl09