I am having an issue where the I am trying to use some Regular Expression in a constraint. The issue is it is evaluating the Regex as a string, and throwing an error. "C开发者_运维技巧annot convert String '\d+' to long"
Here is the code
.MapPageRoute("Parts",
"{PartName}/{Part}/",
"~/Inventory/Default.aspx",
Nothing,
New RouteValueDictionary(New With
{.Part = "\d+"}))
I have pretty much the exact code and it works fine for me.
routes.MapPageRoute("CMS", "{folderID}/{pageTitle}", "~/index.aspx", False, Nothing, New RouteValueDictionary(New With {.folderID = "\d+"}))
I'm using .net 4.0 - perhaps you have 3.5 sp1?
精彩评论