我有这个网站,错误信息是这种格式
<div class="validation-summary-errors">
<span>Password change was unsuccessful. Please correct the errors and try again.</span>
<ul>
<li>The current password is incorrect or the new password is invalid.</li>
</ul>
</div>
Run Code Online (Sandbox Code Playgroud)
现在我想覆盖类"validation-summary-errors"以摆脱'ul''li',使得在"span"标记内的上述错误消息中包含if.所以我有以下代码,如下所示:
<style type="text/css">
.validation-summary-errors li {
list-style: none;
margin: 0;
padding: 5px -10px 5px 0px;
}
</style>
Run Code Online (Sandbox Code Playgroud)
但上面的代码似乎不起作用.如何解决这个问题.
谢谢
我从一个朋友那里得到了这个当前的实现。该项目有一个GridView,如下图
<div ID="divGrid" runat="server">
<asp:GridView ID="docGrid" runat="server" AutoGenerateColumns="False" GridLines="None"
DataSourceID="pagedDatasetSourceControl" OnRowDataBound="docGrid_RowDataBound" OnSelectedIndexChanging="docGrid_SelectedIndexChanging" DataKeyNames="ID"
CssClass="gridTable" AllowSorting="True" AllowPaging="True" meta:resourcekey="docGridResource1">
<PagerSettings Visible="false"></PagerSettings>
<Columns>
..................
</Columns>
<RowStyle CssClass="tableRow"></RowStyle>
<PagerStyle VerticalAlign="Bottom" HorizontalAlign="Right"></PagerStyle>
<AlternatingRowStyle CssClass="tableRowAlt"></AlternatingRowStyle>
</asp:GridView>
</div>
Run Code Online (Sandbox Code Playgroud)
现在,使用此 GridView 的不止一 (1) 个 .cs 类,那么每个实现都不同。然后.cs 类的“ONE”实现了如下所示的“滚动”。
this.divGrid.Attributes.Add("class", "fleft scroll");
this.divGrid.Attributes.Add("style", "width:100%; height:250px;");
Run Code Online (Sandbox Code Playgroud)
但是上面的代码也会滚动标题,所以当我向下滚动时,标题也会滚动。有没有办法通过在我的 .cs 文件中为此类添加“属性”来解决此问题。
谢谢
如何在"a href"标记内嵌入if语句.
比如说
<a id="spnMarkButton" href="javascript:void(0);" @if(condition here) style="display:none;" else style="display:block;" onclick="MarkStore(@storeRating.StoreId);">
Run Code Online (Sandbox Code Playgroud)
但上面的代码不起作用.