1
在动态数据Web应用程序的默认Visual Studio模板中,Global.asax包含以下两个示例路由。默认动态数据模板中是否需要PageAction.Details路由?
// route #1
routes.Add(new DynamicDataRoute("{table}/ListDetails.aspx") {
Action = PageAction.List,
ViewName = "ListDetails",
Model = model
});
// route #2
routes.Add(new DynamicDataRoute("{table}/ListDetails.aspx") {
Action = PageAction.Details,
ViewName = "ListDetails",
Model = model
});
它们只有Action属性不同。 Global.asax中的注释表示这两条路径用于配置处理所有CRUD行为的单个页面。
为什么路线#2是必要的?它有什么作用吗? ListDetails.aspx不查看路由的Action属性。看起来,当我注释掉路由#2并且我在Global.asax中只有路由#1时,一切运行良好。路线#2看起来像没有使用过。