现在我必须解决MVC.Asp.Net项目中的一些错误。在工程中的我有路线:MVC.ASP.NET和路由问题
的Global.asax
routes.MapRoute(
"Category no name",
"_C{id}.cfm",
new { controller = "Products", action = "Category" },
new { id = @"\d+" }
);
控制器:
public ActionResult Category(int id)
{
// Break point here
// doing smth
return View();
}
鉴于我有链接:当我使用Visual
<a href="@Url.Action("Category", "Products", new { id = category.CategoryId })">@category.Name</a>
一切工作正确Studio Development Server,但是当我尝试在本地IIS服务器上运行项目时(我使用http://localhost/TestSite)这个链接有问题。它不起作用,我不能在我的控制器中陷入断点。
为什么我有这种行为?可能对我的链接错误吗?我无法在global.asax中更改路由。
谢谢,您的任何想法
你使用IIS(5/6)。如果是这样,请检查这个网址http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx和http://blog.stevensanderson.com/ 2008/07/04/options-for-deployment-aspnet-mvc-to-iis-6/ –