如何在新标签页中打开生成的pdf [英] how to open generated pdf in new tab

查看:224
本文介绍了如何在新标签页中打开生成的pdf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我从我的ajax弹出按钮单击生成pdf.问题是一旦我生成了pdf,它就会在同一弹出窗口中显示,如何在新标签页中打开它?
下面是代码

//将PDF发送到浏览器
MemoryStream流=新的MemoryStream();
pdfRender.Save(stream,false);
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ContentType =应用程序/pdf";
HttpContext.Current.Response.AddHeader("content-length",stream.Length.ToString());
HttpContext.Current.Response.BinaryWrite(stream.ToArray());
HttpContext.Current.Response.Flush();
stream.Close();
HttpContext.Current.Response.End();

Hi,

Im generating pdf from my ajax popup button click. the issue is once i generate the pdf its showing in the same popup how to open it in new tab?
below is the code

// Send PDF to browser
MemoryStream stream = new MemoryStream();
pdfRender.Save(stream, false);
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ContentType = "application/pdf";
HttpContext.Current.Response.AddHeader("content-length", stream.Length.ToString());
HttpContext.Current.Response.BinaryWrite(stream.ToArray());
HttpContext.Current.Response.Flush();
stream.Close();
HttpContext.Current.Response.End();

推荐答案

您可以在ajax弹出窗口中使用超链接……并像这样使用
< asp:超链接target ="_ blank" xmlns:asp =#unknown">
You can use Hyperlink in ajax popup......and use like this
<asp:hyperlink target="_blank" xmlns:asp="#unknown">


这篇关于如何在新标签页中打开生成的pdf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆