【问题标题】:MVC visual studio <link> reference not working in cshtml pageMVC Visual Studio <link> 参考在 cshtml 页面中不起作用
【发布时间】:2016-09-15 17:43:03
【问题描述】:

MVC 项目文件引用不起作用!

<link rel="stylesheet" href="~/css/style.css"> or
<link rel="stylesheet" href="<%= Page.ResolveUrl("~/assets/css/home-page.css") %>" />  not working. Code here >http://qa.wolfsonchildrenschallenge.com/

【问题讨论】:

  • MVC 应用程序中的 C++ 会很有趣!
  • @RustyX 你应该完全重新标记这个。 MVC 是关于模式的,而 VS 是关于 IDE 的问题。 :)
  • 我在另一个 Visual Studio 项目中工作过,我会参考这样的链接 " /> 虽然这在这个项目中不起作用?

标签: c# visual-studio model-view-controller


【解决方案1】:

确保服务器上的根目录与本地计算机上的相同。 另一件事是使用 ..\ 去父目录

【讨论】:

    猜你喜欢
    • 2016-05-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多