0

I am developing a MVC 3 Web Application and just tried to deploy it on IIS 7.5

The page is shown, but all the images as well as url path is not working at all.

I search through a lot of sources and found out that it seems to be compulsory for a MVC application to have all path being enclosed in either:

 @Url.Action
 @Url.Content
 @Html.Action

and so on. So I tend to change all my relative path by using those valid method.

I understand it should be a correct way to use all those valid mvc helpers, but I am just a beginner and this is my first web application. My question is: Is it possible to use any method to "resolve" the relative path so that it can be found even after deployed?

Really need help here... thank you very much....

shennyL
  • 2,764
  • 11
  • 41
  • 65
  • If you images work on your local machine and not after deploy this is maybe a routing issue. You should try to find the configuration problem instead of creating a workaround. – dknaack Dec 07 '11 at 09:45
  • Hi, all images and url works fine in local machine.. Any possible configuration issues you could point out so I can investigate on it?? Really appreciate that... – shennyL Dec 07 '11 at 09:47
  • I remember that i have same problem long time ago. The problem was that my "application" was no "virtual directory" in IIS. – dknaack Dec 07 '11 at 09:50
  • ya, I dont have any virtual directory on IIS, how to create one? – shennyL Dec 07 '11 at 09:51
  • Try http://www.hosting.com/support/dedicated/iis/virtualdirectory – dknaack Dec 07 '11 at 09:54

1 Answers1

0

You are not correct that you need to use those helpers for all URLs. There is nothing to prevent you from outputting URLs 'manually', as literals, or as you have done above.

Something wonky has happened with the paths of the files on your server upon deployment, most likely.

Andrew Barber
  • 39,603
  • 20
  • 94
  • 123
  • Hi, can you tell me more details about how should I set the paths for my files on the server?? really thanks a lot... – shennyL Dec 07 '11 at 09:45
  • I will mark this as answer since I am doing like this: http://stackoverflow.com/questions/8412837/use-a-variable-that-store-image-path-in-razor-url-content/8460776#8460776 – shennyL Dec 10 '11 at 23:34