-
-
Save mahizsas/e1f26bae2c259d6803a7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Related Properties | |
- HttpRuntime.AppDomainAppVirtualPath | |
- Request.ApplicationPath | |
Methods for getting physical file path: | |
- System.Web.HttpContext.Current.Server.MapPath() | |
Methods for generating content URL: | |
- System.Web.UI.Control.ResolveUrl() or Page.ResolveUrl() | |
- System.Web.Mvc.UrlHelper.GenerateContentUrl() | |
- System.Web.VirtualPathUtility.ToAbsolute() | |
Example of UrlHelper.GenerateContentUrl: | |
var context = new HttpContextWrapper(HttpContext.Current); | |
string url = UrlHelper.GenerateContentUrl("~/Images/photo.jpg, context); | |
References | |
- ResolveUrl in ASP.NET - The Perfect Solution | |
http://www.codeproject.com/Articles/53460/ResolveUrl-in-ASP-NET-The-Perfect-Solution |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment