Skip to main content
 首页 » 编程设计

c#之View 页面上的 MVC CSS(不是_layout)不起作用

2024年02月06日11xxx_UU

我对 MVC4 CSS 有疑问。 我在另一个名为“registerUser.cshtml”的 View 页面中包含一个名为 registration.css 的 CSS 文件。这个页面就像 mvc4 razor 中的内容页面。 但问题是 CSS 无法正常工作。

我该如何解决这个问题。 我还在 BundleConfig.cs 中包含了

bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/registration.css")); 

但它也不起作用。帮我。

请您参考如下方法:

使用

@Styles.Render("~/Content/css") 

代替

@Styles.Render("~/Content/registration.css")