Try add the following name space

System.Web.UI.HtmlControls.HtmlHead

HtmlHead header = this.Page.Header as HtmlHead;

       If rblCSS1.SelectedValue = "ShowCSS1" Then

       {

           HtmlLink link = new HtmlLink();

           link.Attributes.Add("href", "~/DIRECTORY_PATH/css1.css");

           link.Attributes.Add("media", "screen");

           link.Attributes.Add("rel", "stylesheet");

           link.Attributes.Add("type", "text/css");

           header.Controls.Add(link);

       }


On 28 January 2011 18:23, Edwin Wambua <eddwak@gmail.com> wrote:
Thanks.
Sounds very simple but I can't get it to work.I got some additional info here It doesnt recognise the stylesheet.Href I suspect there's a namespace I havent included apart from System.Web.UI.Page and  System.Web.UI.HtmlControls or is it referenced differently in VS2010,which I'm using?







_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke



_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke