【发布时间】:2014-02-20 17:10:15
【问题描述】:
我尝试列出从 SearchController 发送的模型数据提供的数据。但是,我收到了这个错误,我找不到解决方法。
一个文件中只允许有一个“模型”语句。
这是导致错误的代码:
@if (ViewBag.Type == "nomPoste")
{
@model IEnumerable<Monitoring.Models.PosteModel>
if (Model != null)
{
foreach (var item in Model)
{
//...
}
}
if (Model == null)
{
//...
}
}
@if (ViewBag.Type == "nomApplication")
{
@model IEnumerable<Monitoring.Models.AppMetierModel>
if (Model != null)
{
foreach (var item in Model)
{
//...
}
}
if (Model == null)
{
//...
}
}
请问我该如何解决?
【问题讨论】:
标签: c# asp.net asp.net-mvc asp.net-mvc-4 views