我使用下面的代码从URL在新标签而不是新窗口中打开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} .p df','_ newtab');' – 2011-12-27 14:37:45