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 }

);

}

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