Hi,
I am having problem in writing the stylesheet using C# code-behind. I have written a code, but it is not affecting my pages. Can any one please tell me how to write... This is the code
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
<link rel="stylesheet" type="text/css" media="all" href="../Css/landing.css" />
<style type="text/css">
/*<![CDATA[*/
#banner { background-image:url../images/banner1.jpg) }
#splash{background-image:url(../images/active_bg.jpg) }
/*]]>*/
</style>
and I have written like this....
protected void Page_Init(object sender, EventArgs e)
{
HtmlLink link = new HtmlLink();
link.Attributes.Add("type", "text/css");
link.Attributes.Add("rel", "stylesheet");
link.Href = "~../Css/landing.css";
Page.Controls.Add(link);
HtmlLink linkMain = new HtmlLink();
linkMain.Attributes.Add("type", "text/css");
linkMain.Attributes.Add("rel", "stylesheet");
linkMain.Href = "#banner{ background-image:url(../images/banner1.jpg) }";
Page.Controls.Add(linkMain);
HtmlLink linkSplashButtons = new HtmlLink();
linkSplashButtons.Attributes.Add("type", "text/css");
linkSplashButtons.Attributes.Add("rel", "stylesheet");
linkSplashButtons.Href = "#splash{ background-image:url(../images/active_bg.jpg) }";
Page.Controls.Add(linkSplashButtons);
}
Can any please tell me how to write this
I am having problem in writing the stylesheet using C# code-behind. I have written a code, but it is not affecting my pages. Can any one please tell me how to write... This is the code
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
<link rel="stylesheet" type="text/css" media="all" href="../Css/landing.css" />
<style type="text/css">
/*<![CDATA[*/
#banner { background-image:url../images/banner1.jpg) }
#splash{background-image:url(../images/active_bg.jpg) }
/*]]>*/
</style>
and I have written like this....
protected void Page_Init(object sender, EventArgs e)
{
HtmlLink link = new HtmlLink();
link.Attributes.Add("type", "text/css");
link.Attributes.Add("rel", "stylesheet");
link.Href = "~../Css/landing.css";
Page.Controls.Add(link);
HtmlLink linkMain = new HtmlLink();
linkMain.Attributes.Add("type", "text/css");
linkMain.Attributes.Add("rel", "stylesheet");
linkMain.Href = "#banner{ background-image:url(../images/banner1.jpg) }";
Page.Controls.Add(linkMain);
HtmlLink linkSplashButtons = new HtmlLink();
linkSplashButtons.Attributes.Add("type", "text/css");
linkSplashButtons.Attributes.Add("rel", "stylesheet");
linkSplashButtons.Href = "#splash{ background-image:url(../images/active_bg.jpg) }";
Page.Controls.Add(linkSplashButtons);
}
Can any please tell me how to write this