在ASP.net Core中使用BeginCollectionItem [英] Using BeginCollectionItem in ASP.net Core

查看:147
本文介绍了在ASP.net Core中使用BeginCollectionItem的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不能在asp.net核心中使用Steve Anderson的BeginCollectionItem.使用时我在局部视图中出现错误

I cannot use BeginCollectionItem by Steve Anderson in asp.net core. I got an error in my partial view when I use

@using (Html.BeginCollectionItem("Entries")) 
{

}

在未引用的程序集中定义了"HtmlHelper"类型.您必须添加对程序集'System.Web.Mvc,Version = 2.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35'的引用.

The type 'HtmlHelper' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

是否有另一种方法可以在ASP.net核心中实现BeginCollectionItem的功能?

is there an alternative way to achieve the functionality of BeginCollectionItem in ASP.net core?

推荐答案

我移植了原始的BeginCollectionItem以便与.Net Core和.Net Framework 4.6+上的ASP.Net Core一起使用.

I ported the original BeginCollectionItem to work with ASP.Net Core on .Net Core and .Net Framework 4.6+.

https://www.nuget.org/packages/BeginCollectionItemCore

这篇关于在ASP.net Core中使用BeginCollectionItem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆