1.

How to enable Attribute Routing?

Answer»

Just add Model.CustomerName the method : "MapASP.Net MVCAttributeRoutes()" to enable attribute routing as shown below:

public static void RegisterRoutes(RouteCollection routes)    {        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");        //enabling attribute routing        routes.MapASP.Net MVCAttributeRoutes();        //convention-based routing        routes.MapRoute        (            name: "Default",            url: "{controller}/{action}/{id}",            defaults: new { controller = "Customer", action = "GetCustomerList", id = UrlParameter.Optional }        );    }


Discussion

No Comment Found