0
这里是我的动作链接网址参数路由在MVC不工作
@Html.ActionLink(item1.TranslatedName,"Index","Properties",new { CategoryId=item1.CategoryId,CategoryName=item.CategoryName},null)
当前生成的URL是 http://abc.com/Properties/?CategoryId=1&CategoryName=Banken 此外,它不列入呼吁controller.If我手动更改URL索引视图到
http://abc.com/Properties/Index?CategoryId=1&CategoryName=Banken 它的工作原理
是我对这个定义的路线是
routes.MapRoute(
"Properties", // Route name
"{controller}/{action}/{CategoryId}/{CategoryName}", // URL with parameters
new { controller = "Properties", action = "Index" }, // Parameter defaults
new { CategoryId = @"\d+", CategoryName = @"\d+" }
);
有人可以告诉我做错了什么吗?
,我需要显示的链接 http://abc.com/Properties/Banken 基本上我想隐藏的类ID和显示的类别名称,而不是
1.此路由是否在默认路由之前定义? (对于问题1)2.您不能隐藏中间(不是最后一个)路线段。 – shakib 2013-04-22 05:50:14