Is it possible to call a function inside an action method that will eventually generate a new (aka nested) request to the same server?
This comes up because I am trying to use the evohtmltopdf pdf converter to combine several pdfs into one. The problem: The individual pdfs are also generated by the same server.
The snippet from my action method below creates an error message indicating that the converter can’t fetch the /Attachment/Pdf doc while still handling the current request.
// create pdfDocument with main content retrieved from RenderViewToString output
// [...]
// Now add appendixes by handing converter urls and letting it fetch the docs.
UrlHelper url = new UrlHelper(HttpContext.Request.RequestContext);
HtmlToPdfElement attachment = new HtmlToPdfElement(0, 500, url.Action("Pdf", "Attachment");
pdfDocument.Pages[summary.LastPageIndex].AddElement(attachment);
Is this really not possible and if so, how do I get around the restriction?
Duffy
Turns out the problem was somewhere else and the snippet above did work in the end.