-2

In my project i have create dynamic control like text box and call action method on button click.In action method i want to access all values for control which is dynamically created.I have used Request.Form but it will return me null value in my case.So please help me how can i achieve it.

user1722447
  • 119
  • 3
  • 13

2 Answers2

0

you can access form data by Request

Request["fieldName"]

Eanthmue
  • 471
  • 2
  • 5
0

When you create your form using @Html.BeginForm, your action can accept FormCollection collection. Then, you'll have access to all your form control values.

How can a formcollection be enumerated in ASP.NET MVC?

Just create a Test Controller using the wizard "With Read/Write Actions" and review the Create code. This will show you how it works.

Community
  • 1
  • 1
L_7337
  • 2,650
  • 28
  • 42