在新选项卡中打开文件

编程入门 行业动态 更新时间:2024-10-27 13:34:39
本文介绍了在新选项卡中打开文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

HEllo Experts, 我正在创建一个PDF表单并填写Vb中的字段。那部分我做得很好。现在我尝试单击按钮以填充PDF表单,然后在新的选项卡/窗口中打开它。 这是我的代码 以下代码在Page1.aspx

HEllo Experts, I am working on quite bit sometime on creating a PDF form and filling the fields from Vb. I was doing pretty good on that part. Now I am trying to click on a button to Fill the PDF Form and then open it in a new tab/window. Here is my code below code is in Page1.aspx

ListFieldNames() FillForm() Server.Transfer("~/Page2.aspx")

在Page2.aspx中我喜欢以下

In Page2.aspx I have like below

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load Response.ContentType = "Application/pdf" Response.AddHeader("content-length", Session("binaryData").ToString().Length.ToString()) Response.BinaryWrite(Session("binaryData")) Response.End() End Sub

但是,它没有在新标签/窗口中打开。 如果有人可以帮我这个,我将不胜感激。

However, it is not opening in new tab/window . I would appreciate if someone can help me with this.

推荐答案

下面是确切的链接以帮助您解决问题所需。 提前致谢。 http:// www .aspsnippets / Articles / ASP.Net-Response.Redirect-or-Server.Transfer-Open-new-window.aspx [ ^ ] Hi, below is the exact link to help what you need to solve your query. Thanks in advance. www.aspsnippets/Articles/ASP.Net-Response.Redirect-or-Server.Transfer-Open-new-window.aspx[^]

尝试向浏览器发送重定向以在新窗口中打开page2,而不是传输。 Instead of a transfer, try send a redirect to the browser to open page2 in a new windows. response.write("<script>"); response.write("window.open('page2.html','_blank')"); response.write("</script>");

欲了解更多信息,请点击此处: www.aspsnippets/Articles/ASP.Net-Response.Redirect- or-Server.Transfer-Open-new-window.aspx [ ^ ] 祝你好运!

For more info, check here: www.aspsnippets/Articles/ASP.Net-Response.Redirect-or-Server.Transfer-Open-new-window.aspx[^] Good luck!

无论什么请求Page1需要在新窗口中请求它。如果通过表单提交获得page1.aspx,则需要_blank作为表单上的目标 < form target =_ blankaction =page1.aspx > 或者如果page1.aspx是通过链接获得的话 < a target =_ blankhref =page1.aspx... Whatever requests "Page1" needs to request it in a new window. If page1.aspx is got to via a form submission you need _blank as a target on the form <form target="_blank" action="page1.aspx"> or if page1.aspx is got to via a link <a target="_blank" href="page1.aspx" ...

更多推荐

在新选项卡中打开文件

本文发布于:2023-11-27 20:49:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1639553.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:选项卡   文件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!