我有一位控制者认为:
public ActionResult Sold()
{
using (WipDBEntities db = new WipDBEntities())
{
ViewData.Model = db.GetSummaryProiect("Test").ToList();
return View();
}
}
除非我试图从圆顶中抽取参数,否则这种工作是徒劳的。
public ActionResult Sold(string PrjCode)
{
using (WipDBEntities db = new WipDBEntities())
{
ViewData.Model = db.GetSummaryProiect(PrjCode).ToList();
return View();
}
}
难道你会帮助我,那么,我会 new新的一刀切,大概会一米。
EDIT
我有这样做的路线。
routes.MapRoute(
"Componente", // Route name
"Componente/Sold/{PrjCode}", // URL with parameters
new { controller = "Componente", action = "Sold", PrjCode= "" } // Parameter defaults
);
The url look as [hostname]/Componente/Sold/Release/code>