【发布时间】:2015-03-14 11:55:23
【问题描述】:
我使用像这样的 MVC 助手:@Styles.Render("~/Content/css") 在页面上添加样式,但我不喜欢到处都是这种相对路径。如果我更改文件夹结构,则很难修复所有事件。
我是否可以在某处配置以设置 @Styles 应该映射到 '~/Content' 和 @Scripts 到 ~/Scripts 以便能够而不是 @Styles.Render("~/Content/css") 只写
例如@Styles.Render("main.css")?
【问题讨论】:
-
我已经编辑了你的标题。请参阅“Should questions include “tags” in their titles?”,其中的共识是“不,他们不应该”。
标签: c# .net asp.net-mvc asp.net-mvc-4 asp.net-mvc-5