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


About author


.NET Trainer & Instructor

Abhishek Luv is a skilled .NET and ASP.NET Trainer with more than 11 years of teaching experience, specializing in C#, ASP.NET Core MVC, Entity Framework Core, Visual Studio, LINQ, Repository and Unit of work pattern, ASP.NET Core Web API, Git and Github, Angular, and more. He has trained students worldwide and is passionate about helping them achieve success in the field.

Abhishek holds a Bachelor's degree in Computer Applications and completed a Computer Hardware course in 2004. Since his school days, Abhishek has had a keen interest in computers and enjoys playing retro games like Super Mario Bros and Contra in his free time. He is also interested in networking, ethical hacking, and bug bounty hunting, and keeps himself up-to-date with the latest developments in these areas.

Recent Blog Posts





Reading Corner Updated for 2018

by Abhishek Luv, Friday, May 25, 2018 at 10:53 PM

Read more