【问题标题】:Dynamic data model "Visible Tables" count always Zero动态数据模型“可见表”计数始终为零
【发布时间】: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


【解决方案1】:

在我的情况下,这是由于缺少带有 GridViewPager.ascx 的 ~/DynamicData/Content 文件夹造成的。 如果在调试中查看 Global.DefaultModel.VisibleTables 的异常,您可以检查这一点。

【讨论】:

    猜你喜欢
    • 2014-03-22
    • 1970-01-01
    • 2011-02-07
    • 1970-01-01
    • 1970-01-01
    • 2014-04-18
    • 1970-01-01
    • 2021-09-22
    • 1970-01-01
    相关资源
    最近更新 更多