ASP MVC 导入 CSS
我是 ASP.NET MVC 新手,我正在尝试将 CSS 文件包含到我的视图中。
该视图是强类型的,并且有一个列表支架模板,它链接到一个母版页,该母版页本身链接到一个 css 文件,并且对于主幻灯片工作正常,但是当尝试将视图链接到单独的 css 文件时,我不能,因为我不能包含标签。
有人知道我该如何解决这个问题吗?
I am new to ASP.NET MVC and I am trying to include a CSS file into my view.
The view is strongly typed and has a List Scaffold Template, it is linked to a master page which itself is linked to a css file and works fine for the master slide but when trying to link the view to a seperate css file I cant as I cannot include tags.
Anybody know how I can resolve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该在您的 site.master 页面的 head 标签中添加一个新的内容占位符,我总是有一个名为“HeadContent”的内容占位符,我用它来包含我只想在各个页面上使用的脚本和 css。
You should add a new content place holder in your site.master page in the head tags, i always have one called "HeadContent" which i use for inclusion of scripts and css that i only want on individual pages.