在我的控制器中,我采取了行动:
[HttpGet]
public ActionResult CreateAdmin(object routeValues = null)
{
//some code
return View();
}
和http帖子:
[HttpPost]
public ActionResult CreateAdmin(
string email,
string nameF,
string nameL,
string nameM)
{
if (email == "" || nameF == "" || nameL == "" || nameM == "")
{
return RedirectToAction("CreateAdmin", new
{
error = true,
email = email,
nameF = nameF,
nameL = nameL,
nameM = nameM,
});
}
变量 routeValues inhttp get Action
始终为空。如何正确地将对象作为参数传递给[http get] Action
?