1

I have web application let us say "client" where contents are controlled by CMS (using MVC3 areas). Both applications are in the same project and the same solution. We just added area for CMS. The CMS or admin area has upload image functionality then the client displays the contents uploaded by admin. We don't have issue if admin and client is hosted on the same IIS directory however our business needs that both admin and client should be deployed on different directory this will become.

CMS: http://cms.com/admin

Client: http://client.com/

All content uploads take place at cms.com and contents will be displayed at client.com

My main issue is that the project was not designed to get images from other web directory. For example currently all images get the path from client.com

<img src="http://client.com/Content/Uploads/img1.jpg"/>
<img src="http://client.com/Content/Uploads/img2.jpg"/>
<img src="http://client.com/Content/Uploads/img3.jpg"/>

Now my question is, is there easiest way a URL helper or anything I can implement without going through modifying all images to reference http://cms.com/Content/Uploads source? Please help.

Jobert Enamno
  • 4,403
  • 8
  • 41
  • 63
  • 1
    How about a helper method that accepts the image file name. Then that method reads a config that will tell you the location of the images. Then the method will concatenate the config value (location) plus the image and return that to your view. In that manner, you can change the config (location) anytime without changing your code in your view ever - just to know where to get the image. – von v. May 02 '13 at 04:03
  • @von v amazing suggestion. I will explore that option. Thank you so much – Jobert Enamno May 02 '13 at 04:20

0 Answers0