是否可以仅将样式表添加到内容页?
在 asp.net webforms 项目中,我只需要向内容页面添加外部样式表,
如果我将 css 链接放在 <%@ Page>
声明之后,则会出现错误,指出
Error 103 Validation (XHTML 1.0 Transitional): Content is not supported outside 'script' or 'asp:content' regions.
If I put it
标记内错误是
Error 104 Cannot switch views: Validation (XHTML 1.0 Transitional): Element 'link' cannot be nested within element 'td'.
Is it possible to add a stylesheet only to content page?
In a asp.net webforms project, I need to add external style sheet only to content page,
If I put css link after the <%@ Page>
declaration it gives an error saying
Error 103 Validation (XHTML 1.0 Transitional): Content is not supported outside 'script' or 'asp:content' regions.
If I put it inside <asp:Content>
tag error is
Error 104 Cannot switch views: Validation (XHTML 1.0 Transitional): Element 'link' cannot be nested within element 'td'.
Is it possible to add a style sheet only to content page?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该在母版页的头部部分创建一个占位符。然后在内容页面中,如果你想包含js,css,...放在这个占位符上,除非将其保留为空。
You should create a place holder in the head section in master page. Then in the content page, if you want to include js, css, ... put on this place holder, unless keep it empty.