Click here to Skip to main content
15,887,828 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
I am using asp.net,C#,VS 2005,sql server 2005..


i have a tag : <link rel="stylesheet" href="calendar.css" type="text/css" />

now i have to place this tag inside asp:content like :
<asp:Content ID="Content2" ContentPlaceHolderID="MainContentPlaceHolder" Runat="Server">

<link rel="stylesheet" href="calendar.css" type="text/css" >
it is giving error like:
Error 4 Cannot switch views: Validation (XHTML 1.0 Transitional): Element 'link' cannot be nested within element td.

i hav a master page wihich is designed using hTML table..

but it allows adding javascript to content page......

Any help plz

regards
karan
Posted

1 solution

C#
protected override void OnInit( EventArgs e )
{
    this.Header.InnerHtml += "<link rel="stylesheet" href="calendar.css" type="text/css" /link type=\"text/css\" rel=\"Stylesheet\" href=\"styleSheet.css\" />";
    base.OnInit(e);
}

you can use the about code in c# and try it,it may work
 
Share this answer
 
v2
Comments
sairam.bhat 26-May-11 4:34am    
thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900