Quantcast
Channel: DevNet Questions
Viewing all articles
Browse latest Browse all 8834

Attribute Routing in ASP.NET Web API 2

$
0
0
Hi, we are trying to use attribute routing so we can have multiple post or get methods on the same controller. I tried adding GlobalConfiguration.Configuration.MapHttpAttributeRoutes() as per here but I end up getting my CMS 404 page. I added it to my CustomWebAPIModule's OnInit method after the call to MapHttpRoute(@Default@, @custom/{controller}/{id}@, new { id = RouteParameter.Optional }); that's described in the documentation. Is there a way to use attribute routing in Kentico? Convention routing keeps returning the multiple method error, though I added a mapping like so: customapi/{controller}/{action}/{id}.Thanks in advanceUsing K11, portal template model

Viewing all articles
Browse latest Browse all 8834

Trending Articles