gpt4 book ai didi

c# - 如何使用响应在新选项卡中打开页面。在 asp.net 重定向

转载 作者:可可西里 更新时间:2023-11-01 08:57:28 24 4
gpt4 key购买 nike

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

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
}

最佳答案

试试这个。这对我来说肯定有用......

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>");
}

关于c# - 如何使用响应在新选项卡中打开页面。在 asp.net 重定向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34510275/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com