Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在 C# 中创建一个 HtmlInputCheckBox 并且我正在尝试为它设置一个 css,但我不能。谁能给我一个示例代码? 例如,下面的一个不起作用。
HtmlInputCheckBox FieldCtrl = new HtmlInputCheckBox(); FieldCtrl.ID = "CheckBox1"; FieldCtrl.Style = "CheckBox";
.Net 并没有直接公开很多普通的 HTML 属性,但是您可以通过 Attributes 集合访问它。
FieldCtrl.Attributes["class"] = "MyCssClass";