Evg*_*kiy 5

更新

string将此添加到Global.asax路由

            routes.MapRoute(
                "Name of route", // Route name
                "Restaurants/{cityid}/", // URL with parameters
                new { controller = "Restaurants", action = "Index" } // Parameter defaults
            );
Run Code Online (Sandbox Code Playgroud)

这是控制器:

public ActionResult Index(string city, int cuisine = 0, int ChineseMaxPrice=0)
{
  Return View();
}
Run Code Online (Sandbox Code Playgroud)

就像int cuisine = 0 - 如果未在querystring中设置此参数,则将默认值设置为parameter

string city - 是一个应该在字符串中的参数(不是可选的)