【发布时间】:2012-01-28 13:35:23
【问题描述】:
我正在使用以下代码从 url 打开带有下拉选择值的文件
Protected Sub ddlPS_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlPS.SelectedIndexChanged
ClientScript.RegisterStartupScript(Me.GetType(), "openfile", String.Format("var w = window.open('http://foods.shakarganj.com.pk/pdf/{0}.pdf');", ddlPS.SelectedValue), True)
End Sub
问题是,当我从下拉列表中选择值时,它会在窗口中打开文件并刷新父页面。我想避免父页面刷新并希望在新选项卡中而不是在新窗口中打开文件。
【问题讨论】:
-
在 Firefox 中这将工作
var w = window.open('http://foods.shakarganj.com.pk/pdf/{0}.pdf','_newtab');