我有一个动作如下
public ActionResult searchresult(int Race, string province, string City)
{
var q = (................ my query.......)
return View(q);
}
并在RouteConfig中:
routes.MapRoute(
name: "searchresult",
url: "Home/searchresult/{Race}/{Province}/{City}",
defaults: new { controller = "Home", action = "searchresult" }
);
但在网址中我得到http://localhost:2140/Home/searchresult?Race=3&Province=tehranCity=tehran
为什么它不会显示为http://localhost:2140/Home/searchresult/3/tehran/tehran