EDIT
通过以下答案之一,我能够纠正表格内渲染的此问题。我仍然在我的列表视图中看到这个问题。我已经为 ListView 尝试过这个 CSS,但它没有解决问题。
/* FIX FOR CALENDAR IN TABLE */
.DateTime_Edit
{
white-space: nowrap;
}
.DateTime_Edit table
{
border: solid 0 #FFFFFF;
width: 0;
height: 0;
padding: 0;
margin: 0;
}
.DateTime_Edit table tr td
{
border: solid 0 #FFFFFF;
padding: 0;
margin: 0;
}
/* LISTVIEW, NOT WORKING */
.DateTime_Edit table.listview
{
border: solid 0 #FFFFFF;
width: 0;
height: 0;
padding: 0;
margin: 0;
}
.DateTime table.listview tr td
{
border: solid 0 #FFFFFF;
padding: 0;
margin: 0;
}
WITHIN A LISTVIEW
alt text http://www.imageunload.com/public/15867/CSSIssue2.png?no_history http://www.imageunload.com/public/15867/CSSIssue2.png?no_history
WITHIN A TABLE
alt text http://www.imageunload.com/public/15852/CSSIssue.jpg?no_history http://www.imageunload.com/public/15852/CSSIssue.jpg?no_history
Field Template Definition:
<%@ Control Language="C#" CodeBehind="DateAjaxCalendar_Edit.ascx.cs" Inherits="WarehouseLogging.DateAjaxCalendar_EditField" %>
<div class="DateTime_Edit">
<asp:TextBox ID="TextBox1" runat="server" Text='<%# FieldValueEditString %>' CssClass="droplist"></asp:TextBox>
<asp:Image runat="Server" CssClass="CalendarIcon" ID="imgCalendar1" ImageUrl="~/Images/calendar.gif" />
<ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" PopupButtonID="imgCalendar1"
TargetControlID="TextBox1" CssClass="custcal1">
</ajaxToolkit:CalendarExtender>
<ajaxToolkit:FilteredTextBoxExtender ID="fltrTextBox1" runat="server" TargetControlID="TextBox1"
FilterType="Custom, Numbers" ValidChars="/">
</ajaxToolkit:FilteredTextBoxExtender>
<asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" CssClass="droplist"
ControlToValidate="TextBox1" Display="Dynamic" Enabled="false" />
<asp:DynamicValidator runat="server" ID="DynamicValidator1" CssClass="droplist" ControlToValidate="TextBox1"
Display="Dynamic" />
</div>
另一个解决方案是用另一个命名样式覆盖这些样式。新样式需要出现在 .css 文件本身中上述表格样式之后。 (css 的优先顺序是它在 .css 文件中出现的位置...)为该控件指定特定样式将阻止其他样式将来执行相同的操作。
我编写了这个样式,将其放置在 Site.css 文件的末尾,并将整个“DateTime_Edit”FieldTemplate 控件包装在其中:
.DateTime_Edit
{
white-space: nowrap !important;
}
.DateTime_Edit table
{
border: solid 0 #FFFFFF !important;
width: 0 !important;
height: 0 !important;
padding: 0 !important;
margin: 0 !important;
}
.DateTime_Edit table tr td
{
border: solid 0 #FFFFFF !important;
background-color: #FFFFFF !important;
padding: 0 !important;
margin: 0 !important;
}
编辑:
向“td”添加背景颜色。
添加 !important 到一切(可能不需要)
希望默认的 Site.css 文件将在后续版本中更新。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)