1

I have created the following MapRoute function. And it's being called right from Application_Start() in Global.asax.

public static class RouteConfig
{
    public static void RegisterRoutes( RouteCollection routes )
    {
        routes.MapRoute(
                name: "TestMe",
                url: "TestMe.axd",
                defaults: new { controller = "Access", action = "SignOn" }
            );
    }
}

While I can access the specific controller if I use

http://localhost/TestSite/Access/SignOn, 

I can't access it with this URL.

http://localhost/TestSite/TestMe.axd.

Can someone please point out what I am missing here?

Many thanks!!

Kyle
  • 406
  • 7
  • 20
  • It is trying to search TestMe.axd file on physical location.. check your IIS mappings to fix it. or else you might need to write HTTPHandler to avoid this error. – K D Nov 11 '15 at 15:51
  • Perhaps you need to remove `.axd` handlers in your `Web.Config` – haim770 Nov 11 '15 at 15:52
  • I did remove them from , it was the first thing to do. But wasn't working still. By the way, the handler look like this: – Kyle Nov 11 '15 at 15:57

1 Answers1

1

Found some information from this link

I added

<modules runAllManagedModulesForAllRequests="true" /> 

into my Web.config and it's working now.

Community
  • 1
  • 1
Kyle
  • 406
  • 7
  • 20