Hi I am deploying an MVC application on IIS on Win7. I have deployed it on localhost/appPortal. appPortal is configured as application rather than virtual directory. Unfortunately the application root in MVC gets mapped to localhost instead of localhost/appPortal. This is breaking all my links to scripts, css, images etc. Can anyone help me in understanding why this happens and how to fix it?
ASP.Net MVC Application points to localhost instead of application directory
asp.netasp.net-mvciis-7
Related Topic
- .net – ASP.NET Web Site or ASP.NET Web Application
- C# – How to handle multiple submit buttons in ASP.NET MVC Framework
- Asp.net-mvc – Setting up virtual directory when using IIS for ASP.NET MVC debugging
- Asp.net-mvc – ASP.NET MVC – Set custom IIdentity or IPrincipal
- R – ASP.NET MVC Application in Sharepoint 2007 virtual directory
- C# – File Upload ASP.NET MVC 3.0
Best Answer
More information would be interesting on how you are creating the links.
The first thing to check is that the application is correctly created in IIS, which I suppose it is. (If not you'll probably get errors from nested web.config files)
The second thing, urls should be created like this and not directly:
Maybe this question about Url.Content shows you more options. Check as well MSDN documentation on UrlHelper and HtmlHelper.