Remove a CSS class from HTML element in the code behind file

后端 未结 7 2203
清歌不尽
清歌不尽 2021-02-19 03:15

I have the following on my interface / webform:

Now I have a condition in my

7条回答
  •  青春惊慌失措
    2021-02-19 03:41

    Me.mydiv.Attributes.Remove("class")
    

    is much better since it won't leave a stub behind. It'll produce a cleaner HTML tag.

    If you use this,

    Me.mydiv.Attributes("class") = ""
    

    it will produce this instead

    OR

提交回复
热议问题