Abhishek Luv

Freelance Trainer for ASP.NET MVC, Entity Framework..

Accessing Form Data Into the Controller Using the Request Object in ASP.NET MVC

Accessing form data inside a controller is a very common scenario.

Note: Post updated with source code files posted on gist.github.com

Steps required to do :

  • Create a controller with Get and Post methods
  • Inside the HttpPost action method access the form data values using the Request object
  • Create a Create.cshtml View file with a form using Html.BeginForm
  • Create a breakpoint and check the form values

Comments