<body runat="server" id="body">
protected System.Web.UI.HtmlControls.HtmlGenericControl body; ... string strColor = System.Configuration.ConfigurationSettings.AppSett ings["bgColor"]; body.Attributes.Add("bgColor", strColor);
Thanks, Radha Srikanth
Thanks and Regards, GokulNath Nithy.
Thanks Karthik www.f5Debug.net
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> <script type="text/javascript" language="javascript"> function test() { var colorVal = "<%= color %>"; document.getElementById("<%=form1.ClientID%>").style.backgroundColor = colorVal ; } </script> </head> <body onload="test();"> <form id="form1" runat="server"> <div> test<br /> test<br /> test<br /> test<br /> test<br /> test<br /> </div> </form> </body> </html> in code behind: public partial class _Default : System.Web.UI.Page { string _color; protected void Page_init(object sender, EventArgs e) { //get the color value from database here.. //i set here red as constant value; color = "red"; } public string color { get { return _color; } set { _color = value; } } }
Login to post response