Maruf Ahammed Juwel Maruf Ahammed Juwel - 2 months ago 31
C# Question

Html.BeginCollectionItem("Gifts")) { } Does not exist

Can any one please help me .

@model LioM.Models.Gift
@using (Html.BeginCollectionItem("Gifts"))
{

}


this is my MVC5 partial view. It shows an error does not contain a definition for
BeginCollectionItem

Answer

Install BeginCollectionItem HtmlHelper from nuget:

PM> Install-Package BeginCollectionItem

And make sure it's Namespace is in your view:

@using HtmlHelpers.BeginCollectionItem