“模型”与视图页面MVC4中的声明冲突

时间:2014-03-24 11:43:07

标签: asp.net-mvc-4

当我尝试这样做时,我发现了一个奇怪的错误。

<tr>
    <td>
    @Html.LabelFor(Model=>Model.Company_Name)
    </td>
    <td>
   @Html.TextBoxFor(Model=>Model.Company_Name)
    </td>
</tr>
  <tr>
       <td>
         @Html.DisplayNameFor(m=>m.LOB_NAME)
        </td>
        <td>
            @Html.DropDownListFor(x=>x.LOB_NAME,Model.Lobdata) 
//Error here saying 'Model' conflicts with the declaration'System.Web.Mvc.WebViewPage<TModel>.Model'

//Similarly when i comment the above line the error is shifting down    
            @Html.DropDownListFor(x=>x.Lead_Source,Model.leadsourcedata) 

1 个答案:

答案 0 :(得分:0)

找到它Here

Model应为model

  @Html.LabelFor(model=>model.Company_Name)