【问题标题】:CleintDependency path with no Layout specified未指定布局的 CleintDependency 路径
【发布时间】:2012-03-31 03:32:12
【问题描述】:

我有一个 ASP.NET MVC 3 站点,它使用 ClientDependency framework 进行 dep。分辨率(CSS/JS)。

我的基本路径在 /Shared/_Layout.cshtml 中定义如下:

@MvcHtmlString.Create(Html.RenderCssHere(new List<IClientDependencyPath> {
      new BasicPath("Base", "~/Content/themes/base"),
      new BasicPath("Content", "~/Content")
    }))

我想要一个没有标准布局的页面。我通过调用来强制它

@{
    Layout = null;

    Html.RequiresCss("FileUpload/fileUpload.css", "Content", 20);
}

但是,我不能再请求一个部门。如上所示,因为没有定义“内容”路径。

我对 ClientDependency 框架比较陌生,那么在非布局视图中获取我的依赖项的最佳方式是什么?

【问题讨论】:

    标签: asp.net-mvc-3 client-dependency


    【解决方案1】:

    我需要在View 以及RenderCss/JsHere 元素中的某处声明路径,所以如果我不使用共享布局,我必须在我的自定义页面中重新声明它.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多