Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Replace the RouteHandler in custom route

$
0
0

In MVC 5 I can do stuff like

<div class="comment-right-col">
publicclassCustomRouteHandler:MvcRouteHandler{protectedoverrideIHttpHandlerGetHttpHandler(RequestContext requestContext){// add to HttpContext
           requestContext.HttpContext.Items["Custom"]= data;// or RouteData
           requestContext.RouteData.Values.Add(key, value);}returnbase.GetHttpHandler(requestContext);}}// define route with custom handler Route customRoute =newRoute(
    url:...,
    defaults:null,
    constraints:...,
    routeHandler:newCustomRouteHandler()});

routes.Add(customRoute);

How can I do this in MVC 6 / vNext?

</div>

Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>