使用asp.net在新选项卡中打开html页面

时间:2016-03-29 07:31:14

标签: c# asp.net

我尝试使用asp.net中的c#在新标签页面中打开新的html页面。我有

protected void btnShowMatrix_Click(object sender, EventArgs e)
    {
        string url = @"http://localhost/IMApp/static/knit.html";
        Response.Redirect(url);
    }

这很好但我需要在新标签中打开该html页面。有没有简单的方法,怎么做。非常感谢。

1 个答案:

答案 0 :(得分:0)

你可以试试这个:

protected void btnShowMatrix_Click(object sender, EventArgs e)
{
   Page.ClientScript.RegisterStartupScript(
   this.GetType(),"OpenWindow","window.open('http://localhost/IMApp/static/knit.html','_newtab');",true);
}
相关问题