Yes
- In the body tag, add runat=’server’ and give the tag an id (e.g. id=’bodyID’).
- In the class definition in the code-behind, add
VB.NETProtected bodyID As System.Web.UI.HtmlControls.HtmlGenericControl
C#
protected System.Web.UI.HtmlControls.HtmlGenericControl bodyID ;
- In code, use the attributes collection to set the bgcolor attribute:
VB.NETbodyID.Attributes.Add('bgcolor', 'green')
C#
bodyID.Attributes.Add('bgcolor', 'green');
Share with