-1

I just started working on ASP.net MVC. i found the following code in the Global.asax. i knew that this code is used to manage routing in the application.But, i was unable to understabnd this piece of code:

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

    public static void RegisterRoutes(RouteCollection routes)
    {
        ***routes.IgnoreRoute("{resource}.axd/{*pathInfo}");***

        routes.MapRoute(
            "Default", // Route name
            "{controller}/{action}/{id}", // URL with parameters
            new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
        );

    }

The first line i was un clear of..can any one please explain what is the exact purpose of it?

Sai Avinash
  • 4,683
  • 17
  • 58
  • 96

1 Answers1

0

ASP.NET MVC allows you to define routes with URL patterns that it should simply ignore. In the your case, all the url contains .axd will be ignored. There is no Controller and Action will interact with .axd request. You can find more detail about .axd here - What is an .axd file?.

Community
  • 1
  • 1