1

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
  • the url in the browser navigation bar is relative to the subfolder or relative to the main root? Have you tried to manually insert the subfolder/controller/action/id path? Commented Dec 9, 2009 at 21:32

1 Answer 1

2

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" />
Sign up to request clarification or add additional context in comments.

1 Comment

And in your javascript, css, etc?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.