How do you calculate a relative path in ASP.NET MVC?
also, if you want the relative path inside your controller, you can use:
string pathName = VirtualPathUtility.ToAbsolute(string.Format(@"~/images/PhotoAlbum/{0}/", propertyId));
or:
string pathName = VirtualPathUtility.ToAppRelative(string.Format(@"~/images/PhotoAlbum/{0}/", propertyId));
depending on your need..
hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With