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";