I am creating a view for a model in ASP.NET MVC. I am using @HTML.LabelFor
@Html.LabelFor(m => m.Name, htmlAttributes: new { @class = "control-label col-md-2" })
but I am getting this error:
Error CS0411
The type arguments for method 'LabelExtensions.LabelFor<TModel, TValue>(HtmlHelper, Expression<Func<TModel, TValue>>, object)' cannot be inferred from the usage. Try specifying the type arguments explicitly.