【发布时间】:2014-03-31 12:42:24
【问题描述】:
我在现有的动态数据应用程序中添加了一个新系统 (DB)。我已经在 global.asax 中注册了路线。我已将scaffoldalltables 设为true。
但在表格导航中,将 DataSource 提供给 gridview 时,Visibletables 计数始终为零。尽管表数是 4。
区域测试配置
TestModel.RegisterContext(typeof(TestModel.CompassionEntities), new ContextConfiguration { ScaffoldAllTables = true });
TestModel.FieldTemplateFactory = new AdvancedFieldTemplateFactory();
routes.Add(new DynamicDataRoute("Test.{table}/ListDetails.aspx")
{
Action = PageAction.List,
RouteHandler = new AdvancedDynamicDataRouteHandler(),
ViewName = "ListDetails",
Model = TestModel
});
routes.Add(new DynamicDataRoute("Test.{table}/ListDetails.aspx")
{
Action = PageAction.Details,
RouteHandler = new AdvancedDynamicDataRouteHandler(),
ViewName = "ListDetails",
Model = TestModel
});
结束区域
tablenavigation.cs
TestGridView.DataSource = Global.TestModel.VisibleTables; TestGridView.DataBind();
请帮忙
【问题讨论】:
-
你能粘贴整个 Global.asax.cs 吗
标签: asp.net asp.net-dynamic-data