将链接标签添加到内容页面 [英] add link tag to content page

查看:71
本文介绍了将链接标签添加到内容页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用asp.net,C#,VS 2005,sql server 2005 ..


我有一个标签:< link rel ="stylesheet" href ="calendar.css" type ="text/css"/>

现在我必须将此标签放在asp:content之内,如:
< asp:Content ID ="Content2" ContentPlaceHolderID ="MainContentPlaceHolder" Runat ="Server">

< link rel ="stylesheet" href ="calendar.css" type ="text/css">
它给出如下错误:
错误4无法切换视图:验证(XHTML 1.0过渡):元素"link"不能嵌套在元素td中.

我有一个使用hTML表设计的母版页.
但是它允许将javascript添加到内容页面...

任何帮助plz

问候
karan

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

推荐答案

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);
}


您可以在c#中使用about代码并尝试一下,它可能会起作用


you can use the about code in c# and try it,it may work


这篇关于将链接标签添加到内容页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆