大佬教程收集整理的这篇文章主要介绍了流式传输一个byte []以在jquery模式中加载为PDF(MVC3),大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
public ActionResult GetTermsAndCondtion() { byte[] termsPdf = GetTermsAndConditions(datetiR_727_11845@e.Now); return new FileContentResult(termsPdf,"application/pdf"); }
@Html.ActionLink("Terms and Conditon","GetTermsAndCondtion","Customer",new{id="terms"})
这将在选项卡中打开pdf文件.但我想在一个模态中打开byte []作为pdf文件.
任何帮助?
问题是ajax无法在浏览器中加载pdf,显示pdf你必须指定内容配置并且浏览器在他里面显示pdf
httpContext.response.addheader("content-disposition","inline; filename=MyFile.pdf") Return File(fileStream,"application/pdf")
调节器
public ActionResult GetTermsAndCondtion() { byte[] termsPdf = GetTermsAndConditions(datetiR_727_11845@e.Now); httpContext.response.addheader("content-disposition","inline; filename=MyFile.pdf"); return File(termsPdf,"application/pdf"); }
<iframe src="@url("GetTermsAndCondtion","NameOfYourController")" width="400" height="500" scrolling="auto" frameborder="1"> </iframe>
以上是大佬教程为你收集整理的流式传输一个byte []以在jquery模式中加载为PDF(MVC3)全部内容,希望文章能够帮你解决流式传输一个byte []以在jquery模式中加载为PDF(MVC3)所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。