【发布时间】:2016-06-14 19:52:19
【问题描述】:
我通过 Rotativa 创建了一个 PDF,我需要为每个页面添加动态页眉和页脚。所以我使用视图来显示页眉和页脚。
下面是代码:-
string customswitch = string.Format("--allow {0} --footer-html {0} --allow {1} --header-html {1}",
Url.Action("Footer", "Home", new { area = "" }, "http"), Url.Action("Header", "Home", new { area = "" }, "http"));
[AllowAnonymous]
public ActionResult Footer()
{
return View();
}
[AllowAnonymous]
public ActionResult Header()
{
return View();
}
它在本地运行良好,但在部署之后。我看不到页眉和页脚。我在 IIS 上使用 Windows 身份验证,如果我启用了我不想启用的匿名身份验证,我只能在服务器上看到 HEADER 和 FOOTER。 您能否建议任何解决此问题的方法。
【问题讨论】:
标签: asp.net-mvc wkhtmltopdf rotativa