tags:

views:

217

answers:

1

Hi all,

I have an application that uses ASP.NET MVC. I have it deployed to a Crystal Tech server (hence, no direct access to IIS control panel).

Initialy this was running in the root directory and everything was OK. The client then decided that it needed to run in a subdirectory. I moved the app there and the home index page comes up, but every other page tries to access the the controller/action/page/view in the original root directory. I don't understand this, since the references were all contextual (i. e. using ../controller/action as opposed to mysite.com/controller/action).

Am I doing something wrong here? What are my options?

Thanks, James

+1  A: 

I would use the UrlHelper to generate the links. This would ensure that they are relative to the application path.

<a href="<%= Url.Action( "action", "controller" ) %>">Link Text</a>

and

<img src="<%= Url.Content( "~/images/myimg.jpg" ) %>" alt="My Image" />
tvanfosson