Q:

Get URI for image on ASP.NET server

I need to load a png stored in my asp.net mvc project into my program as a bitmap image.  However, the constructor for BitmapImage only takes a Uri object.  How can I access the image? 
Doing something like
new Uri(VirtualPathUtility. ToAbsolute("~\\Content\\image.png"))

tells me that the format of the URI could not be determined.  However it works if I hard code the path (C:\\...etc.) 

A:

You would likely want to Map the relative path that you have to the physical path on the server, to do that you can use Server. MapPath();
http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.mappath.aspx

