有一个需求如下:指定某个Area的路由(Area:Wx)在其后面添加用户名或者ID作为URL参数,即/Wx/xiaohong/或/Wx/xiaoming/photo的样子。
这样的话修改一下路由就好了,如下:
context.MapRoute( "Wx_restaurant_with_id2", "Wx/{rid}/{controller}/{action}/", new { controller = "Rester", action = "Index", rid = "" } );
原文:http://www.cnblogs.com/huangsheng/p/6422888.html