My goal is to share images, css, js, etc. across multiple websites that are all hosted under the same parent virtual directory in IIS. Of course, I could hard code the images paths, but I'd hoped .NET had a method that could intelligently resolve URLs using the IIS configuration.
Here is my file/virtual directory structure:
Parent Site (Virtual Directory) default.aspx mypage.aspx otherpage.aspx images - logo.jpg css - site.css Subsite1 (Virtual Directory) - default.aspx - products.aspx Subsite2 (Virtual Directory) - default.aspx - products.aspx - miscellaneous.aspx
Parent Site
, Subsite1
, and Subsite2
are all virtual directories set up for http://parentsite.com, http://subsite1.com, and http://subsite2.com, respectively. I want to share images, js, css, etc. across these sites.
Is there a method in .NET that will resolve ~/images/logo.jpg
as http://parentsite.com/images/logo.jpg when called from one of the subsites (e.g., http://subsite.com/default.aspx)?