tags:

views:

345

answers:

4

What is the equivalent to Page.ResolveUrl in ASP.NET MVC available in the Controller?

A: 
Server.MapPath() //returna full path

or

url.content()
Paul Creasey
Doesnt Server.MapPath() return the physical disk path rather than expanding a full URL, like Page.ResolveUrl("~") ?
Mark Redman
yeah your right it does, you could hack around it but `url.content` is available instead!
Paul Creasey
A: 

try using Server.MapPath().

ydobonmai
+2  A: 

It is Url.Content:

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

This should do what your looking for...

System.Web.VirtualPathUtility.ToAbsolute("~/")
Carlo