开发者

change css through vb.net

开发者 https://www.devze.com 2022-12-14 13:00 出处:网络
I have a style.css f开发者_C百科ile which gives a color the the body of every aspx page, since every page calls that css file. But in one page I need to change the color of body through vb.net code. i

I have a style.css f开发者_C百科ile which gives a color the the body of every aspx page, since every page calls that css file. But in one page I need to change the color of body through vb.net code. is there a way to do this?


You could set it as a style attribute of the body tag.

Me.Body.Style.add("background-color", "#FFFF00")

(assuming your body tag has an id and a runat="server" attribute)


Give the <body> an ID and a runat="server" attribute, and then you can access it in the code behind.

for example:

<body ID="body" runat="server">

codebehind:

body.CssClass = "whateverYouWant"
0

精彩评论

暂无评论...
验证码 换一张
取 消