【发布时间】:2012-09-09 17:46:35
【问题描述】:
假设我在 Global.asax 中有一个类似的路由声明:
RouteTable.Routes.MapPageRoute("Products", "products/{productno}/{color}", "~/mypage.aspx");
如何配置路由,使其仅在 {productno} 是有效 Guid 且 {color} 是整数值时拦截请求?
- 确定网址:/products/2C764E60-1D62-4DDF-B93E-524E9DB079AC/123
- 无效的网址:/products/xxx/123
无效的 url 将被另一个规则/路由选择或完全忽略。
【问题讨论】:
标签: c# asp.net .net routing webforms