A form collection is a form containing an arbitrary number of the same set of fields.
Questions tagged [formcollection]
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"))
{

Lord Vermillion
- 5,264
- 20
- 69
- 109
10
votes
1 answer
should formcollection be empty on asp.net mvc GET request
i am posting a simple action.
public void Login(FormCollection formCollection)
{
...
}
Even with few querystring values, the formcollection.Count is 0. Is it by behaviour?

Adeel
- 19,075
- 4
- 46
- 60
9
votes
2 answers
Check whether an element exists in mvc formcollection
I am receiving some data in mvc controller as FormCollection. I would like to check if there is a particular key exists in the formcollection.
public JsonResult FullRetailerUpdate(FormCollection data)
{
//I want to check if
…

s.k.paul
- 7,099
- 28
- 93
- 168
9
votes
2 answers
How do you initialize a FormCollection with properties in .NET?
I've tried the usual way of:
var form = new FormCollection { "WeekList" = weekfilter, "PracticeList" = practicefilter}
and all possible deviations I could think of, but ultimately had to seperate it apart as:
var form = new…

LaRae White
- 1,222
- 3
- 17
- 35
8
votes
1 answer
FormCollection Empty in ASP.NET Mobile View
When I am using this code as web view, it works fine, but when with developer option in Chrome I select Mobile View, FormCollection shows empty strings in the controller
VIEW (Edit updtaed)

Abdul
- 1,416
- 9
- 26
- 57
8
votes
1 answer
How can a formcollection be enumerated in ASP.NET MVC2
I was previously using How can a formcollection be enumerated in ASP.NET MVC? 's implementation but now I'm on VS2010 and MVC2 its complaining:
Error 1 Cannot implicitly convert type 'System.Web.Mvc.IValueProvider' to…

Chris McKee
- 4,298
- 10
- 48
- 83
8
votes
4 answers
asp.net-mvc get a dictionary in post action or how to transform FormCollection into a dictionary
anybody knows how to transform the FormCollection into a IDictionary or how to get a IDictionary in the post action ?

Omu
- 69,856
- 92
- 277
- 407
8
votes
2 answers
Proper way of using FormCollection in ASP.NET MVC2 Create Method?
I am currently developing an application with the new ASP.NET MVC2 framework. Originally I started writing this application in the ASP.NET MVC1 and I'm basically just updating it to MVC2.
My problem here is, that I don't really get the concept of…

Faizan S.
- 8,634
- 8
- 34
- 63
7
votes
3 answers
Getting all selected checkboxes from a FormCollection
I have a form which contains a whole bunch of checkboxes and some other types of control too. I need to retrieve the names of each selected checkbox.
What is the best way to do this? Can I do it with a linq query maybe?
So in pseudocode, I'm looking…

fearofawhackplanet
- 52,166
- 53
- 160
- 253
7
votes
2 answers
FormCollections missing from ASP.Net 5
What happened to FormCollections from System.Web.Mvc? In the past I would use something like this string value = data.GetValues(key).FirstOrDefault(); where data is a formcollection. Now when I try to implement a FormCollection it comes from…

HendPro12
- 1,094
- 3
- 17
- 50
7
votes
2 answers
How to find elements that are not deeper than a selector?
I am building a jQuery plugin to manage form collections. The plugin aims to add add, remove, move up and move down buttons to alter that collection.
A collection's root node always contains a selector, such as .collection.
A button can be…

Alain Tiemblo
- 36,099
- 17
- 121
- 153