将链接标签添加到内容页面

编程入门 行业动态 更新时间:2024-10-21 22:57:05
本文介绍了将链接标签添加到内容页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用asp,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,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

更多推荐

将链接标签添加到内容页面

本文发布于:2023-11-27 08:14:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1637235.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:标签   页面   链接   内容

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!