Questions tagged [begincollectionitem]

A handy HtmlHelper that was originally authored by Steve Sanderson. It's based on the MVC2 style of converting HTTP POST data into ViewModel collection properties using the out of the box DefaultModelBinder, and is quite helpful when your HTML forms contain collections.

This is a handy HtmlHelper that was originally authored by Steve Sanderson. It's based on the MVC2 style of converting HTTP POST data into ViewModel collection properties using the out of the box DefaultModelBinder, and is quite helpful when your HTML forms contain collections.

This class is in the HtmlHelpers.BeginCollectionItem namespace. To use it in a view you would either put a @using HtmlHelpers.BeginCollectionItem directive at the top of the view, or to make it available to multiple views, add an entry in the system.web.webPages.razor/pages/namespaces section of your Views web.config(s). When installing this into an MVC3 or higher project, the second option is done automatically for your root Views/Web.config file:

37 questions
0
votes
1 answer

Asp.net mvc updating dropdownlist in parent's page submitted by a modal popup

I have a main page that loads a partial view which is using Html.BeginCollectionItem("employees") because I am using a jQuery tab. (so the user can add more employee forms) Inside of my Employee partial view has a dropdownlist for selecting…
bbusdriver
  • 1,577
  • 3
  • 26
  • 58
0
votes
1 answer

A view to add and remove items from a collection on the same view

I'm creating a View that allows the user to add and remove objects in list in a particular way that the client wants. The user has to be able to add or remove multiple forms on the page before submitting. When the page posts it needs to display…
0
votes
0 answers

Using Html.BeginCollectionItem Properly

I am new to MVC/Razor/Web and am hoping to eventually be able to edit a list of items, right now I am just trying to display these items using Html.BeginCollectionItem and it is not working (no error, just does not display my items.) I have listed…
hrh
  • 658
  • 1
  • 14
  • 24
0
votes
1 answer

HtmlBeginCollectionItem Get Current Item

I need: Acess /Client/Create Add dynamically Partial Views (/Product/Card) and bind them to Client.Products In each Partial View when i click in a button open a bootstrap modal windows where i can set Product's information Close the modal and…
Rieth
  • 305
  • 1
  • 4
  • 13
0
votes
1 answer

Passing a list to partialview, BeginCollectionItem()

I want to pass a list to PartialView that has BeginCollectionItem(). Here is the code, InquiryOrderViewModel public class InquiryOrderViewModel { public InquiryOrder InquiryOrder { get; set; } public List
Isuru
  • 950
  • 1
  • 13
  • 34
0
votes
1 answer

BeginCollectionItem() gives only lastly appended item for PostBack

InquiryOrderViewModel public class InquiryOrderViewModel { public InquiryOrder InquiryOrder { get; set; } public List InquiryOrderDetails { get; set; } } InquiryOrderIndex View and the Script to add items @model…
Isuru
  • 950
  • 1
  • 13
  • 34
0
votes
1 answer

@Html.BeginCollectionItem with IValidatableObject and MemberName mismatch

While using @Html.BeginCollectionItem helper by Steven Sanderson I'm trying to validate the collection items on the server side using the IValidatableObject interface. I want to prevent the user from selecting two equal items. So for example, given…
1 2
3