【问题标题】:nested requests in asp.net mvcasp.net mvc 中的嵌套请求
【发布时间】:2012-03-26 11:54:12
【问题描述】:

是否可以在最终生成一个新的(也就是嵌套的)请求到同一个服务器的操作方法中调用一个函数?

这是因为我正在尝试使用 evohtmltopdf pdf 转换器将多个 pdf 合并为一个。问题:单个 pdf 文件也是由同一台服务器生成的。

下面我的操作方法中的 sn-p 会创建一条错误消息,指示转换器在处理当前请求时无法获取 /Attachment/Pdf 文档。

    // 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);

这真的不可能吗?如果是,我该如何绕过限制? 达菲

【问题讨论】:

    标签: asp.net asp.net-mvc asp.net-mvc-2


    【解决方案1】:

    原来问题出在其他地方,上面的 sn-p 最终确实起作用了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多