response.redirect到新标签中的表单没有弹出窗口? [英] response.redirect to a form in new tab without popup ?

查看:80
本文介绍了response.redirect到新标签中的表单没有弹出窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从服务器端的按钮单击打开新选项卡中的表单。当我们执行response.redirect时,它会在同一个标​​签页面中打开页面。我想在新标签页中打开该页面。我尝试了window.location脚本,但这将打开一个弹出窗口而不是新选项卡的新表单。任何人都可以告诉我如何实现这一目标?

how can i open a form in a new tab from button click on server side. when we do response.redirect it will open page in same tab . i want to open that page in a new tab. i tried window.location script but that will open new form as a pop up window and not a new tab. can anyone please tell me how can i achieve this ?

推荐答案

试试这个:



Try This:

ScriptManager.RegisterStartupScript(Me, Me.GetType(), "key", "window.open('vehicle_trackView.aspx');", True)


请试试这个..



我在IE中测试了这个。



Please try this..

I have tested this in IE.

protected void Page_Load(object sender, EventArgs e)
   {
       if (!IsPostBack)
       {
           Response.Write("<script>");
           Response.Write("window.open('Default2.aspx','_blank')");
           Response.Write("</script>");
       }

   }


使用window.open。像这样:

use window.open. Like this:
protected void btnNewEntry_Click(object sender, EventArgs e)
{
   Page.ClientScript.RegisterStartupScript(this.GetType(),"OpenWindow","window.open('YourURL','_newtab');",true);
}


这篇关于response.redirect到新标签中的表单没有弹出窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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