Questions tagged [formcollection]

A form collection is a form containing an arbitrary number of the same set of fields.

185 questions
22
votes
1 answer

Making an async HttpClient post request with data from FormCollection

I am doing an Asp.Net MVC 4 project and am looking to an internal request (like a proxy) to our api service. This is what the index method looks like in my controller. I'm stuck at the PostAsync part. [HttpPost] public async Task
Erik5388
  • 2,171
  • 2
  • 20
  • 29
17
votes
4 answers

What is correct behaviour of UpdateModel in ASP.NET MVC?

I am interested to know what you guys feel should be deemed "correct behaviour" in terms of the UpdateModel method in ASP.NET MVC. The reason I ask here is perhaps if this functionality is "by design" somebody could clarify as to why it is the way…
GONeale
  • 26,302
  • 21
  • 106
  • 149
15
votes
2 answers

Getting multiple checkboxes from FormCollection element

Given multiple HTML checkboxes: ... How do I retrive an array of integers from a FormCollection…
Petrus Theron
  • 27,855
  • 36
  • 153
  • 287
14
votes
3 answers

formcollection only holds the selected html.listbox items values? MVC

My scenario is this: I have two listbox's, one that contains all my database items, and an empty one. The user adds the items needed from the full listbox to the empty listbox. I'm using a form to submit all the items the user has added. The problem…
Darcy
  • 5,228
  • 12
  • 53
  • 79
11
votes
2 answers

MVC Razor get option value from select with FormCollection

My view has a Select with elements(options) from my ViewModel. @using (Html.BeginForm("NewUser", "Admin")) {