Author: you've been HAACKED | Posted on: 9/7/2010 11:05:02 PM | Views : 1430

I was drawn to an interesting question on StackOverflow recently about how to override a request for a non-existent .svc request using routing. One useful feature of routing in ASP.NET is that requests for files that exist on disk are ignored by routing. Thus requests for static files and for .aspx and .svc files don't run through the routing system. In this particular scenario, the developer wanted to replace an existing .svc service with a call to an ASP.NET MVC controller. So he deletes the .svc file and adds the following route: routes.MapRoute( "UpdateItemApi" , "Services/api.svc/UpdateItem" , new { controller = "LegacyApi" , action = "UpdateItem" } ); Since api.svc is not a physical file on disk...(read more) ...

Go to the complete details ...