我有一些关于 CSS 和 UI 的问题。似乎当我单击 abutton
并且我的网站中有回发或验证时,我的divs
, tables
, tds
, tr
.. 停止拥有我给他们的价值并自行更改。我讨厌让一切结构如此完美,然后验证控制将其拧紧。
例如:
单击按钮之前和之后APPLY
,并导致验证。
如您所见,它改变了宽度。
我的代码是这样的:
<table>
<tr>
<td style="width: 105px">
<dx:ASPxLabel ID="lblAlarmGroup" runat="server" Text="<%$ Resources:Master, GroupnameText %>"
CssClass="CamelCase" AssociatedControlID="cmbAlarmGroup">
</dx:ASPxLabel>
:
</td>
<td style="width: 155px">
<dx:ASPxComboBox ID="cmbAlarmGroup" runat="server" ValueType="System.Int32" Width="150px"
DataSourceID="sqlDSAlarmGroups" TextField="GroupName" ValidationSettings-RequiredField-IsRequired="true"
ValueField="AlarmsListGroupsID" AutoPostBack="True" OnSelectedIndexChanged="cmbAlarmGroup_SelectedIndexChanged">
<DisabledStyle BackColor="LightGray" ForeColor="Black" />
</dx:ASPxComboBox>
</td>
<td style="width: 5px">
</td>
<td style="width: 105px">
<dx:ASPxLabel ID="lblAlarm" runat="server" Text="<%$ Resources:Master, AlarmText %>"
CssClass="CamelCase" AssociatedControlID="cmbAlarmsList">
</dx:ASPxLabel>
:
</td>
<td style="width: 155px">
<dx:ASPxComboBox Width="150px" ID="cmbAlarmsList" runat="server" ValueType="System.Int32"
AutoPostBack="True" OnSelectedIndexChanged="cmbAlarmsList_SelectedIndexChanged"
TextField="value" ValueField="key" ValidationSettings-RequiredField-IsRequired="true">
<DisabledStyle BackColor="LightGray" ForeColor="Black" />
</dx:ASPxComboBox>
</td>
</tr>
<tr>
<td colspan="5" style="width: 525px">
<hr />
</td>
</tr>
<tr>
<td style="width: 105px">
<dx:ASPxLabel ID="lblSite" runat="server" Text="<%$ Resources:Master, SiteText %>"
CssClass="CamelCase" AssociatedControlID="cmbSite">
</dx:ASPxLabel>
:
</td>
<td style="width: 155px">
<dx:ASPxComboBox Width="150px" ID="cmbSite" runat="server" ValueType="System.Int32"
OnSelectedIndexChanged="cmbSite_SelectedIndexChanged" TextField="value" ValueField="key"
AutoPostBack="True">
<DisabledStyle BackColor="LightGray" ForeColor="Black" />
</dx:ASPxComboBox>
</td>
<td style="width: 5px">
</td>
<td style="width: 105px">
<dx:ASPxLabel ID="lblDepartment" runat="server" Text="<%$ Resources:Master, DepartmentText %>"
CssClass="CamelCase" AssociatedControlID="cmbDepartment">
</dx:ASPxLabel>
:
</td>
<td style="width: 155px">
<dx:ASPxComboBox Width="150px" ID="cmbDepartment" runat="server" ValueType="System.Int32"
TextField="value" ValueField="key" OnSelectedIndexChanged="cmbDepartment_SelectedIndexChanged"
AutoPostBack="True">
<DisabledStyle BackColor="LightGray" ForeColor="Black" />
</dx:ASPxComboBox>
</td>
</tr>
<tr>
<td style="width: 105px">
<dx:ASPxLabel ID="lblLine" runat="server" Text="<%$ Resources:Master, LineText %>"
CssClass="CamelCase" AssociatedControlID="cmbLine">
</dx:ASPxLabel>
:
</td>
<td style="width: 155px">
<dx:ASPxComboBox Width="150px" ID="cmbLine" runat="server" TextField="value" ValueField="key"
ValueType="System.Int32" OnSelectedIndexChanged="cmbLine_SelectedIndexChanged"
AutoPostBack="True">
<DisabledStyle BackColor="LightGray" ForeColor="Black" />
</dx:ASPxComboBox>
</td>
<td style="width: 5px">
</td>
<td style="width: 105px">
<dx:ASPxLabel ID="lblOperation" runat="server" Text="<%$ Resources:Master, OperationText %>"
CssClass="CamelCase" AssociatedControlID="cmbOperation">
</dx:ASPxLabel>
:
</td>
<td style="width: 155px">
<dx:ASPxComboBox Width="150px" ID="cmbOperation" runat="server" ValueType="System.Int32"
TextField="value" ValueField="key" OnSelectedIndexChanged="cmbOperation_SelectedIndexChanged"
AutoPostBack="True">
<DisabledStyle BackColor="LightGray" ForeColor="Black" />
</dx:ASPxComboBox>
</td>
</tr>
<tr>
<td style="width: 105px">
<dx:ASPxLabel ID="lblShift" runat="server" Text="<%$ Resources:Master, ShiftText %>"
CssClass="CamelCase" AssociatedControlID="cmbShift">
</dx:ASPxLabel>
:
</td>
<td style="width: 155px">
<dx:ASPxComboBox Width="150px" ID="cmbShift" runat="server" TextField="value" ValueField="key"
ValueType="System.Int32" AutoPostBack="True">
<DisabledStyle BackColor="LightGray" ForeColor="Black" />
</dx:ASPxComboBox>
</td>
<td style="width: 5px">
</td>
<td style="width: 105px">
<dx:ASPxLabel ID="lblStation" runat="server" Text="<%$ Resources:Master, StationText %>"
CssClass="CamelCase" AssociatedControlID="cmbStation">
</dx:ASPxLabel>
:
</td>
<td style="width: 155px">
<dx:ASPxComboBox Width="150px" ID="cmbStation" runat="server" TextField="value" ValueField="key"
ValueType="System.Int32" AutoPostBack="True">
<DisabledStyle BackColor="LightGray" ForeColor="Black" />
</dx:ASPxComboBox>
</td>
</tr>
<tr>
<td colspan="5" style="width: 525px">
<hr />
</td>
</tr>
<tr>
<td colspan="2" style="width: 260px">
<dx:ASPxLabel ID="lblNoficationInterval" runat="server" Text="<%$ Resources:Master, NotificationSendIntervalText %>"
AssociatedControlID="aspxseNotificationInterval">
</dx:ASPxLabel>
:
</td>
<td style="width: 5px">
</td>
<td colspan="2" style="width: 260px">
<dx:ASPxSpinEdit ID="aspxseNotificationInterval" runat="server" Height="21px" Number="5"
MaxValue="10000" MinValue="5">
</dx:ASPxSpinEdit>
</td>
</tr>
<tr>
<td colspan="2" style="width: 260px">
<dx:ASPxLabel ID="lblExcalationInterval" runat="server" Text="<%$ Resources:Master, EscalationSendIntervalText %>"
AssociatedControlID="aspxseEscalationInterval">
</dx:ASPxLabel>
:
</td>
<td style="width: 5px">
</td>
<td colspan="2" style="width: 260px">
<dx:ASPxSpinEdit ID="aspxseEscalationInterval" runat="server" Height="21px" Number="10"
MaxValue="10000" MinValue="5">
</dx:ASPxSpinEdit>
</td>
</tr>
</table>
我在整个项目中一直遇到这个问题,但我没有提供可靠的解决方案。这发生在你们身上吗?解决方案应该是什么?制作 CSS 类并将所有内容分配给它们?谢谢
编辑:
我从这两个下拉列表中删除了验证,但是当我在其中输入一个值时,它会出现您在图像中看到的内容。它只发生在那种情况下;如果选择的项目是其他项目,则不会发生 UI 混乱
图 3 有什么线索吗?