Html.TextBoxFor 提示出错解决办法

在.cshtml面面中

@Html.TextBoxFor(model => model.Name)

上面语句提示如下错误, 并且model属性不能智能提示

The type arguments for method 'System.Web.Mvc.Html.InputExtensions.TextBoxFor<TModel,TProperty>(System.Web.Mvc.HtmlHelper<TModel>, System.Linq.Expressions.Expression<System.Func<TModel,TProperty>>)' cannot be inferred from the usage. Try specifying the type arguments explicitly.

解法办法

在web.config上添加

<compilation debug="true" targetFramework="4.0"/>
原文地址:https://www.cnblogs.com/season2009/p/2826186.html