开发者

Having an issue with MapPageRoute in Vb.Net Global.asax

开发者 https://www.devze.com 2023-03-11 07:33 出处:网络
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 Str

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号