Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/asp.net-mvc-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在razor mvc3中使用库中的css_Css_Asp.net Mvc 3_Razor - Fatal编程技术网

在razor mvc3中使用库中的css

在razor mvc3中使用库中的css,css,asp.net-mvc-3,razor,Css,Asp.net Mvc 3,Razor,我有一个MVC3RazorWeb应用程序,它使用库中的几个图形组件 我已经设置了库中的所有组件,我需要添加一个css文件到库中,但我不知道怎么做 那么,如何将一个css文件(它是一个库资源)添加到cshtml文件中呢。 我试过这个,但不起作用: @section Styles { <link href="@Url.Content("~/file.css")" />} @节样式{ } 将rel=stylesheet属性添加到该链接中您的\u Layout.cshtml文件是否包含@R

我有一个MVC3RazorWeb应用程序,它使用库中的几个图形组件

我已经设置了库中的所有组件,我需要添加一个css文件到库中,但我不知道怎么做

那么,如何将一个css文件(它是一个库资源)添加到cshtml文件中呢。 我试过这个,但不起作用:

@section Styles {
<link href="@Url.Content("~/file.css")" />}
@节样式{
}

rel=stylesheet
属性添加到该链接中

您的
\u Layout.cshtml
文件是否包含
@RenderSection(“样式”)
?感谢您的回复,我添加了rel=“stylesheet”type=“text/css”/>但我认为该文件无法访问,我把它放在库中,我想从cshtml文件调用它,但我不能。