Open New Window After Button Click and After running Server Side Code

Add your code in button click add this code (replace your link in the code)

private void btn_Click(object sender, EventArgs e)
{
//... Start Tag Code
StringBuilder script = new StringBuilder();
script.Append("<script>");
script.AppendFormat("window.open('{0}', '', '');", link);
script.Append("</scri");
script.Append("pt>");
Page.ClientScript.RegisterStartupScript("opennewwindow",script.ToString());
//... End Tag Code
}

Leave a Reply

Your email address will not be published. Required fields are marked *