1
传入字典的模型项目类型为'...',但此字典需要类型为'...'的模型项目错误类型错误?
有谁知道如何解决此错误?
我的控制器类:
public class MapsController : Controller
{
public ActionResult Index()
{
return View(Project.Find(68));
}
//[AutoRefresh(DurationInSeconds = 30)]
public ActionResult Map()
{
var map = DeviceLocation.FindAll();
Locations l = new Locations();
l.locations = map;
return Json(l, JsonRequestBehavior.AllowGet);
}
}
我的观点
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<App.Models.Project>>" %>
我在我的视图中使用了每个循环,如果我删除IEnumerable,每个循环都不会工作。我用视图代码更新了我的问题。 – Prd 2010-09-22 07:13:02
如果你会显示完整的错误信息,而不是隐藏类型,这将有所帮助。因为类型似乎是问题。同样,展示您的其余观点。 – RedFilter 2010-09-22 13:13:40