开发者

ASP.NET MVC Catch All

开发者 https://www.devze.com 2022-12-27 22:08 出处:网络
The ignore route is defined like this: routes.IgnoreRoute(\"{resource}.axd/{*pathInfo}\"); 开发者_JS百科

The ignore route is defined like this:

routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
开发者_JS百科

Why not

routes.IgnoreRoute("{resource}.axd/{*}");

What is the significance of pathInfo?

Thanks.


Exception will be thrown, route parameter must have name. The meaning of the * sign is explained here File path as MVC route argument


That's just to give the route parameter a name or an exception will be thrown. You could have called it {*foo}.

0

精彩评论

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