views:

253

answers:

2

i hae a style.css file which gives a color the the body of every aspx page, since every page calls that css file. But in 1 page i need to change the color of body through vb.net code. is there a way to do this?

+1  A: 

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"
jball
Then, in style.css, body.whateverYouWant{background-color: Lime ;}
Paul D. Waite
+1  A: 

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)

Gabriel McAdams