Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc 使用Vs2013.Net 4.5的DynamicDataRoute_Asp.net Mvc_Webforms_Visual Studio 2013_Dynamic Data - Fatal编程技术网

Asp.net mvc 使用Vs2013.Net 4.5的DynamicDataRoute

Asp.net mvc 使用Vs2013.Net 4.5的DynamicDataRoute,asp.net-mvc,webforms,visual-studio-2013,dynamic-data,Asp.net Mvc,Webforms,Visual Studio 2013,Dynamic Data,我有一个老的WebForms项目,几年前我在其中成功地添加了动态特性。我还使用DynamicDataRoute添加路由。一切都很好 现在,使用VS2013 4.5,我创建了一个新的web项目,其中包含WebForms、MVC和ApiWeb。 我使用相同的代码来生成动态数据。 有两件事不起作用: 1/类似“xxx/Pages/Page.aspx”的Url在Url栏中显示为“xxx/Pages/Page”,但工作正常 2/像“网站/XXX/id”这样的路由不起作用(404) 我做错了什么?谢谢 以下

我有一个老的WebForms项目,几年前我在其中成功地添加了动态特性。我还使用DynamicDataRoute添加路由。一切都很好

现在,使用VS2013 4.5,我创建了一个新的web项目,其中包含WebForms、MVC和ApiWeb。 我使用相同的代码来生成动态数据。 有两件事不起作用:

1/类似“xxx/Pages/Page.aspx”的Url在Url栏中显示为“xxx/Pages/Page”,但工作正常

2/像“网站/XXX/id”这样的路由不起作用(404)

我做错了什么?谢谢

以下是我在global.asax中的根代码:

    AreaRegistration.RegisterAllAreas();
    GlobalConfiguration.Configure(WebApiConfig.Register);
    RouteConfig.RegisterRoutes(RouteTable.Routes);
    BundleConfig.RegisterBundles(BundleTable.Bundles);
...
    m_MaBaseModel = new MetaModel();
    m_MaBaseModel.RegisterContext(typeof(xxxx.MaBaseEntities), new ContextConfiguration() { ScaffoldAllTables = true });

    RouteTable.Routes.Add(new DynamicDataRoute("Favoris/{table}/{action}.aspx")
    {
        Constraints = new RouteValueDictionary(new
        {
            action = "List|Details|Edit|Insert|BL01|ListDetails"
        }),
        Model = m_MaBaseModel
    });
    RouteTable.Routes.Add(new DynamicDataRoute("Favoris/{table}/{IDActe}/{action}.aspx")
    {
        Constraints = new RouteValueDictionary(new
        {
            action = "List"
        }),
        Model = m_MaBaseModel
    });