I have many images on my small website (asp.internet c# web.application) which are loaded onto my website. I've got a specific domain which i use to load images with however i do not have it incorporated during my markup. So at runtime I wish to add this domain towards the images when they dont have diabetes already added at compile time. What is the easiest way to do this? Could it be using a http module? I realize using this method at runtime may have performance issues therefore if you will find every other ways I'm available to suggestions. The majority of my images have relative pathways. I cant hard code the domain because it changes by atmosphere the applying is running in.
Place the domain inside your web.config's application configurations, then towards the top of the net form or master page, do:
<% string ImagesDomain = System.Configuration.ConfigurationSettings.AppSettings["ImagesDomain"] %>
Then inside your images, do:
<img src="<%=ImagesDomain%>/MyImage.digital" />
Not so difficult. Don't be concerned an excessive amount of concerning the performance hit either, it will be fine.