If I have a form called index.aspx and I want to set the background colour programatically how do I do such a thing? Like if I wanted to set the pages background by calling a method called Changebackground?
Sub ChangeBackground()
' change forms html here
End Sub
You can first make the “body” element a server control, assign it an ID, then set CSS style to the body element’s “style” attribute, for example:
ASPX (Note that “body” element is now a server control):
ASPX.CS:
This code will set the page background to red.