I’m using MVC 3 and C# I would like to know how to retrieve the value for form sent using POST.
her my code, but does not work, thevalue for eventTitle is null. Any idea what I’m doign wrong here? thanks for your time.
[HttpPostAttribute]
public JsonResult AddEventCustom()
{
string eventTitle = Request.Form["EventTitle"];
return Json(new { Message = "Success" }, JsonRequestBehavior.AllowGet);
}
You can simply put the vars you need in the method declaration.
MVC `will handle the mapping for you