我收到此错误,而我正在尝试在网格上填充数据请帮帮我..我尽我所能
我没有使用模型类,而是使用datamodel.edmx,仍然是我收到错误的原因
我正在使用MVC 5
我的控制器
public ActionResult Index()
{
WifyConnectEntities wc = new WifyConnectEntities();
IEnumerable<Connected_User> connected = wc.Connected_User;
return View(connected);
}
我的观点
@model IEnumerable<MarketingEngine.Connected_User>
@using System.Web.Mvc.Html
@using GridMvc.Html
@{
ViewBag.Title = "Index";
}
<h2>Welcome @Convert.ToString(Session["BusinessUser"])</h2>
@Html.ActionLink("Refresh The List", "Refresh")
<html>
<head>
<link href="@Url.Content("~/Content/Gridmvc.css")" rel="stylesheet" />
<link href="@Url.Content("~/Content/bootstrap.min.css")" rel="stylesheet" />
<script src="@Url.Content("~/Scripts/jquery-1.9.1.min.js")"></script>
<script src="@Url.Content("~/Scripts/gridmvc.min.js")"></script>
<div style="width:500px;">
@Html.Grid(Model).Columns(columns =>
{
columns.Add(c => c.User_ID).Titled("User_ID");
columns.Add(c => c.Session_Start).Titled("Session_Start").Filterable(true);
columns.Add(c => c.Duration).Titled("Duration");
}).WithPaging(3).Sortable(true)
</div>
</body>
<html>
答案 0 :(得分:0)
检查web.config中是否有这个:
<compilation debug="true" targetFramework="4.0">