Click to See Complete Forum and Search --> : CSS and .ASCX Files


Taurian110
January 3rd, 2006, 02:17 PM
I created a Web Control Library project to keep all my Web Custom Controls at one place, for some reason I can't figure out how to link my CSS file to the Custom Control. This is what I am doing:


<HEAD>
<link href="/css/Global.css" rel="stylesheet" type="text/css" />
</HEAD>


I also tried this:


<HEAD>
<link href="/css/Global.css" rel="stylesheet" type="text/css" runat="server" />
</HEAD>


Both ways didn't work, then I thought that maybe i could do it from the Code Behind file something like this:


HtmlLink link1 = new HtmlLink();
link1.Href = "/css/Global.css";
link1.Attributes["text"] = "text/css";
link1.Attributes["rel"] = "stylesheet";
this.Header.AddParsedSubObject(link1);


But it gives me following error message
"The type or namespace name 'HtmlLink' could not be found (are you missing a using directive or an assembly reference?)"

Can any one help me resolve this problem? I sure would appreciate all the help that I can get.

P.S.
I am using System.Web.UI.HtmlControls;

Taurian110
January 4th, 2006, 08:46 AM
Any one?? :(