ASP.NET 本地主机路由问题
对 localhost 的调用(使用 VS 2008 集成的 Web 服务器)不起作用(空页面..),
http://localhost:6666
但对远程 IIS 的调用
http://asdf.com/MyApp
被路由到正确的控制器和方法(SearchController -> Search)... MyApp 是 IIS文件夹“Controller”所在的目录...
路由代码:
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Search", action = "Search", id = "" } // Parameter defaults
);
如何解决这个问题,以便它在两个网络服务器上工作?
A call to localhost ( using the VS 2008 integrated webserver ) is not working ( empty page.. )
http://localhost:6666
but a call to a remote IIS
http://asdf.com/MyApp
is routed to the correct controler and method (SearchController -> Search )... MyApp is the IIS directory in which the folder "Controller" is...
The routingcode:
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Search", action = "Search", id = "" } // Parameter defaults
);
How to solve this, so that it's working on both webservers?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,这是一个棘手的问题,我以前也遇到过这种情况。请按照以下步骤操作:
http://haacked. com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx
Yeah, that's a tricky one, it's gotten me before too. Follow this:
http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx