我创建了一条自定义路线
routes.MapRoute("Exams",
"Exams/{id}/{name}",
new { controller = "Exam", action = "SingleExam", id = "", name = (string) null },
new[] { "MockTests.FrontEnd.Controllers" }
);
为此,我正在创建链接
http://localhost:61575/Exams/12/maharashtra+mba+common+entrance+test
但他的错误是
The resource cannot be found
SingleExam代码
public ActionResult SingleExam(int id,string name)
{
return View();
}
其他路线
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "User", action = "Register", id = UrlParameter.Optional },
new[] { "MockTests.FrontEnd.Controllers" }
);
我做错了什么?