Adding css class through aspx code behind

后端 未结 6 812
暖寄归人
暖寄归人 2020-12-08 13:13

I am using aspx. If I have HTML as follows:

I am hoping to dynamically add a css class through the

6条回答
  •  无人及你
    2020-12-08 13:44

    If you want to add attributes, including the class, you need to set runat="server" on the tag.

        

    Then in the code-behind:

    classMe.Attributes.Add("class", "some-class")
    

提交回复
热议问题