找不到资源- MVC -在向导中传递



我有一个默认操作,显示表中的所有项:

public ActionResult Index()
{
    var items = db.ProductSet.ToList();
    return View(items);
}

我在控制器中添加了另一个动作,它应该只显示字段等于特定值的项:

 public ActionResult Details(string _key)
{
     System.Guid gkey = new Guid(_key);
     var items = db.ProductSet.Single(c => c.pKey == gkey);
     return View(items);
}

我用下面的url调用它:

http://localhost:57955/Details/ABBA9914-B55A-48A0-B436-00041FFAEAA7

并得到一个错误:资源无法找到。

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly. 
Requested URL: /Details/A88A9914-B56A-48A0-B436-00041FFAEAB5
有谁能帮我解决这个问题吗?

在url中指定控制器名称:

http://localhost:57955/Home/Details/ABBA9914-B55A-48A0-B436-00041FFAEAA7

最新更新