如何使用响应在新选项卡中打开页面.在asp.net上重定向 [英] How to open page in new tab using the response. redirect at asp.net

查看:46
本文介绍了如何使用响应在新选项卡中打开页面.在asp.net上重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过在按钮单击处理程序中使用 Response.Redirect 来打开新标签或新页面.我正在使用查询字符串来传递一些值.如何在新标签页中打开他的页面?

I want to open a new tab or a new page by using Response.Redirect in a button click handler. I'm using a query string to pass some values. How can I open he page in a new tab?

protected void btnSave_Click(object sender, EventArgs e)
{
    ...//some code to insert records
    Response.Redirect("NewQuote.aspx?val=" + this.txtQuotationNo.Text);//displaying gridview in other page to print what needed
}

推荐答案

尝试一下.这对我来说肯定有用...

Try this. This works sure for me...

protected void btnSave_Click(object sender, EventArgs e)
{
    ...//some code to insert records
    Response.Write("<script>window.open ('NewQuote.aspx?val=" + txtQuotationNo.Text+"','_blank');</script>");
}

这篇关于如何使用响应在新选项卡中打开页面.在asp.net上重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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