安装 html helper,c# – System.Web.Mvc.HtmlHelper不包含的定义

我正在尝试使用

Steve Sanderson’s blog post关于编辑可变长度列表.我已经通过NuGet包管理器安装了dll,并确保命名空间位于Views / web.config文件中.但是,当我尝试编写使用语句时,我出现以下错误.

System.Web.Mvc.HtmlHelper does not contain a definition

for 'BeginCollectionItem' and no extension method 'BeginCollectionItem' accepting a first

argument of type 'System.Web.Mvc.HtmlHelper' could be

found (are you missing a using directive or an assmebly reference

查看/ Web.config中

部分视图(更新)

@model Monet.Models.AgentRelationshipCodes

@using (Html.BeginCollectionItem("AgentRelationshipCodes"))

{

@Html.EditorFor(model => model.EffectiveDate, "NullableDate", new { @class = "relCodeDate2" })@Html.EditorFor(model => model.RelationshipId, "NullableDate", new { @class = "relDistCode1", maxlength = 3 })

@Html.HiddenFor(model => model.ID)

@Html.HiddenFor(model => model.RelCodeOrdinal)

}

控制器(以防万一)

using System;

using System.Collections.Generic;

using System.Configuration;

using System.Data;

using System.Data.Entity.Validation;

using System.Diagnostics;

using System.IO;

using System.Linq;

using System.Net;

using System.Reflection;

using System.Runtime.Serialization;

using System.Text;

using System.Transactions;

using System.Web;

using System.Web.Mvc;

using System.Web.Routing;

using System.Xml;

using Monet.MonetToDss;

using Monet.Common;

using Monet.Models;

using Monet.ViewModel;

using HtmlHelpers.BeginCollectionItem;

public ViewResult NewRelationshipCode()

{

return View("AddRelationshipCodePartial", new AgentRelationshipCodes());

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值