开发者

Using Special Symbols in ASP.NET MVC Routes [duplicate]

This question already has answers here: 开发者_JS百科 ASP.NET MVC: Route with optional parameter, but if supplied, must match \d+ (6 answers) Closed 9 years ago.

I want to use the url such as "/ControllerName/ActionName/Id" Id - only digits or null. But when I use regular expression in MapRoute, "\d{1,4}", I see the exception - error404 page, when I'm trying to see /ControllerName/ActionName/" page.

Also, I don't know, how I can catch exception with special symbol - ". Please, help.Thanx.


Try using ( *|\d{1,4}).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜