DynamicDataRoute with Vs2013 .Net 4.5
-
06-10-2022 - |
Question
I have an old WebForms project in which I successfully add Dynamic feature a few years ago. I also add routing with DynamicDataRoute. All worked fine.
Now, with VS2013 4.5, I create a new web project with both WebForms, MVC and ApiWeb. I use the same code for rooting dynamic data. Two things doesn't works :
1/ Urls like "xxx/Pages/Page.aspx" are displayed in Url bar as "xxx/Pages/Page" but works fine.
2/ Routes like "WebSite/XXX/id" doesn't work (404).
What did I make wrong? Thanks.
Here is my rooting code in 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
});
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow