How do you modify a CSS style in the code behind file for divs in ASP.NET?

前端 未结 4 1505
醉酒成梦
醉酒成梦 2020-12-01 00:21

I\'m trying to modify a CSS style attribute for a div based on the information I get from a database table in the code behind of my aspx page. The following is essentially w

4条回答
  •  [愿得一人]
    2020-12-01 01:21

    Another way to do it:

    testSpace.Style.Add("display", "none");
    

    or

    testSpace.Style["background-image"] = "url(images/foo.png)";
    

    in vb.net you can do it this way:

    testSpace.Style.Item("display") = "none"
    

提交回复
热议问题