我无法访问:
http://localhost:54158/Bull/Details/S.No%20GERRY
http://localhost:54158/Bull/Edit/S.No%20Gurukul
http://localhost:54158/Bull/Edit/S.No%20GR%2013
虽然我可以访问:
http://localhost:54158/Bull/Details/GR%20001
http://localhost:54158/Bull/Edit/TP%20001
简而言之,我无法访问带有 的 URL。(句点)作为参数。
public ActionResult Details(String id)
{
Bull bull = db.Bulls.Find(id);
if (bull == null)
{
return HttpNotFound();
}
return View(bull);
}
我尝试在我的代码中放置断点,但对于无法访问的 URL,应该触发的操作没有。
URL 中的点会导致 404 与 ASP.NET mvc 和 IIShttp://weblogs.asp.net/owscott/archive/2013/01/16/handing-mvc-paths-with-dots-in-the-path.aspx