asp.net-mvc - ASP.NET MVC 中的 Page.ResolveUrl 相当于什么?

标签 asp.net-mvc

Controller 中可用的 ASP.NET MVC 中的 Page.ResolveUrl 等效项是什么?

最佳答案

Url.Content :

ASPX:

<link rel="stylesheet" href="<%= Url.Content("~/Content/style.css") %>" type="text/css" />

Razor :

<link rel="stylesheet" href="@Url.Content("~/Content/style.css")" type="text/css" />

关于asp.net-mvc - ASP.NET MVC 中的 Page.ResolveUrl 相当于什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2452931/

相关文章:

asp.net-mvc - 如何在复杂的向导中为下一步/上一步构建代码?

c# - ? : condition in Razor C#

asp.net-mvc - 如何在 Visual Studio 2017 中创建 MVC 项目?

asp.net-mvc - ASP.NET MVC 与 WebForms : speed and architecture comparison

.net - 如何在 ASP.NET MVC 中创建 CheckBoxListFor 扩展方法?

asp.net-mvc - 如何覆盖 Web Api 方法

asp.net - 丢失 ASP.NET/SQL Server 的 session 状态

css - 如何为 ListBoxFor 添加样式?

asp.net-mvc - 数据库优先 - EntityType xxx 没有定义键。定义此 EntityType 的键

c# - Ajax传递过来的数据在C#中显示为null?