【发布时间】:2017-05-06 09:30:11
【问题描述】:
我的代码是这样的
<th runat="server" id="thTodayToTenTotal" class="redRow">
<th runat="server" id="thTodayToTenTotal" class="redRow">
我从 CodeBehind 中删除了 class="redRow" 这样的属性
thTodayToTenTotal.Attributes.Remove("class");
没关系。
但是“redRow”类可以在我的页面中有很多。如何一次性从整个页面中删除此类名称。然后我想将这个类添加到一个html元素中。我的意思是我有
<th runat="server" id="wantToAddClass">
我像这样从 CodeBehind 添加类
wantToAddClass.Attributes.Add("class", "redRow");
【问题讨论】:
-
你能详细解释一下吗
-
请查看我编辑的问题。谢谢 Satish Patil。
-
您对 Jquery 解决方案持开放态度吗?
-
很确定你想循环浏览控件集合
标签: c#