Take the community feedback survey now.
Take the community feedback survey now.
you would need to add some magic in web.config file:
<configuration>
<system.webServer>
<handlers>
<add name="ExternalResourceHandler"
path="/external/*"
verb="GET"
type="{FQN of your HTTP handler type + assembly name}"/>
</handlers>
</system.webServer>
</configuration>
I did try that but it didn't work.
Instead I had to add this:
routes.Add(new Route("external/{guid}", new ExternalRouteHandler()));
public class ExternalRouteHandler: IRouteHandler
{
publicIHttpHandler GetHttpHandler(RequestContext requestContext)
{
return new ExternalHttpHandler();
}
}
public class ExternalHttpHandler : IHttpHandler
{
public bool IsReusable
{
get { return false; }
}
public void ProcessRequest(HttpContext context)
{
//Your ccustom code here
}
}
hm, interesting. my web.config works just fine. are "run managed stuff for all requests" enabled in web.config?
btw, assume that you need to *insert* this route at the beginning and not adding that (as it might be overwritten by some epi "final not found route")?
Yes, runAllManagedModulesForAllRequests is enabled.
I don't follow your meaning with insert and adding. :)
How do I trigger a HttpHandler on a specific url? For example */external/*
The purpose is for retrieving an external document and stream out to the page.