我已经向现有的动态数据应用程序添加了一个新的系统(DB)。我在global.asax中注册了路由。我将scaffoldalltables设置为true。
但是,在为gridview提供DataSource时,表导航中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 = 全局.TestModel.可见表; TestGridView.DataBind();
请协助