Search code examples
asp.netasp.net-mvcweb-servicesroutesasmx

IgnoreRoute with webservice - Exclude asmx URLs from routing


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("media.aspx");

This works successfully and serves a standard webforms page.

Upon adding the filevistacontrol, I can't seem to ignore any calls the control makes to it's webservice.

Eg the following ignoreRoute still seems to get picked up by the MvcHandler.

routes.IgnoreRoute("FileVistaControl/filevista.asmx/GetLanguageFile/");

The exception thrown is:

'The RouteData must contain an item named 'controller' with a non-empty string value'

Thanks in advance.


Solution

  • I got it to work using this (a combo of other answers):

    routes.IgnoreRoute("{directory}/{resource}.asmx/{*pathInfo}");