Compiler Error Message: CS0135: 'Model' conflicts with the declaration 'System.Web.Mvc.WebViewPage.Model'

前端 未结 2 1924
青春惊慌失措
青春惊慌失措 2020-12-11 02:59

I am using ASP.NET MVC 3. I have created a strongly typed view that has a form. At the bottom of the page I have and ActionLink

  @Html.ActionLink(\"Edit\",         


        
2条回答
  •  有刺的猬
    2020-12-11 03:29

    I guess somewhere in your view you have used a strongly typed helper with a lambda expression using the reserved Model keyword. Like for example:

    @Html.TextBoxFor(Model => Model.SomeProperty)
    

    it should be:

    @Html.TextBoxFor(x => x.SomeProperty)
    

    or any other name.

提交回复
热议问题