开发者

change css through vb.net

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜