我正在使用ASP.NET MVC 3。我创建了一个强类型视图,其中包含一个表单。在页面底部,我有一个ActionLink。
@Html.ActionLink("Edit", "Edit", new { id = Model.UserId})
这将允许用户编辑信息。当我运行应用程序时,我会得到以下错误。
Compiler Error Message: CS0135: 'Model' conflicts with the declaration
'System.Web.Mvc.WebViewPage<TModel>.Model'
这可能是什么。
@Html.TextBoxFor(Model => Model.SomeProperty)
替换为@Html.TextBoxFor(x => x.SomeProperty)
。 - Darin Dimitrov