What is the equivalent to Page.ResolveUrl in ASP.NET MVC available in the Controller?
Doesnt Server.MapPath() return the physical disk path rather than expanding a full URL, like Page.ResolveUrl("~") ?
Mark Redman
2010-03-16 08:38:03
yeah your right it does, you could hack around it but `url.content` is available instead!
Paul Creasey
2010-03-16 08:43:24
+2
A:
It is Url.Content:
<link rel="stylesheet" href="<%= Url.Content("~/Content/style.css") %>" type="text/css" />
korchev
2010-03-16 08:40:56
A:
This should do what your looking for...
System.Web.VirtualPathUtility.ToAbsolute("~/")
Carlo
2010-03-16 14:27:39