c# - ASP.NET Routing - Adding a route only if numeric? -


I am trying to generate a path using ASPNT routing, but I only want to apply it if some values ​​are numeric.

< / P>

Route. Add ("Category 2 archive", new route ("{one class}} {{class}}} {{year} / {month}", new category and posthandler ());

Is it anyway to know whether there are numerical values ​​in {year} and {month} and opposing this routing with other routes.

You can get the filter you want to use:

For routes. Margaret ("Category 1 Erequave", new route ("{one class}" {{date}} {{date}}, {empty}, new {year = @ "^ \ d + $", month = @ "^ \ D + $" }, New category and posthandler ())); ("Category 2 archives", new route ("{classOne} / {class} two} / {year} / {month}", blank, new {year = @ "^ \ D + $", month = @ "^ \ D + $ "}, new category and posthandler ());

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -