Asp.NET MVC in subfolder
i have searched here, googling (with bing;)) and try all the things i have found but i dont get it running.
I have a subfolder created on my webspace at discountasp.net like "MySite". Then i made a virtual directory with the control panel. I published the Site with Visual 开发者_StackOverflow社区 Studio to the path http://blablabla.com/MySite/. My Domain is pointed to this path too.
It looks good but the links like /Home/About/ becomes /MySite/Home/About/ and thats (of course) doesnt work.
How can i change that ? I think its an routing issue.
Please help me.
To create your URLs you should use
@Url.Action(actionName, controllerName)
This will use the routes you specified and it will create correct URLs.
You can also use
@Html.ActionLink(linkText, actionName, controllerName)
To include images and stylesheets use
@Url.Content("~/Content/...")
I got it. Pointing my Domain directly on the subfolder and defining a Outbound rewrite rule on iis solves my problem.
精彩评论