In my controller I got action:
[HttpGet]
public ActionResult CreateAdmin(object routeValues = null)
{
//some code
return View();
}
And http post:
[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,
});
}
variable routeValues in http get Action is always empty. How correctly pass object as parameter to [http get] Action?
Request.Querystringcollection though.[HttpGet] public ActionResult CreateAdmin(bool? error, string email, string nameF, string nameL, string nameM)then the querystring values will be mapped to this variables.