IgnoreRoute with webservice - Exclude asmx URLs from routing

前端 未结 6 646
没有蜡笔的小新
没有蜡笔的小新 2020-12-30 08:48

Im adding the filevistacontrol to my asp.net MVC web application.

I have a media.aspx page that is ignored in the routing with

routes.IgnoreRoute(\"m         


        
6条回答
  •  鱼传尺愫
    2020-12-30 09:47

    It would help if you posted the source for your route configuration. I'm going to take a shot in the dark and say to make sure that your IgnoreRoute() calls are all at the top of your routing definition.

    The way IgnoreRoute works is to create a route that matches the ignored route URL and constraints, and attaches a StopRoutingHandler as the RouteHandler. The UrlRoutingModule knows that a StopRoutingHandler means it shouldn't route the request.

    As we know, the routes are matched in the order of which they are defined. So, if your {controller}/{action}/{id} route appears before your "FileVistaControl/filevista.asmx/GetLanguageFile/" route, then it will match the "{controller}/{action}/{id}" route.

    I may be totally off base here, but it's hard to know without seeing your source. Hope this helps. And post source code! You'll get better answers.

提交回复
热议问题