Open file from browser

Response.ContentType = “application/pdf”;

Response.AddHeader(“content-disposition”, “attachment; filename=” + path);

Response.WriteFile(path);

HttpContext.Current.ApplicationInstance.CompleteRequest();

 

Note. Comment second line to hide download file dialog OR change with this line

Response.AddHeader(“content-disposition”, “inline; filename=” + directory + pathFile);

Open web in new tab

Page.ClientScript.RegisterStartupScript(this.GetType(), “OpenWindow”, “window.open(‘http://www.google.com’, ‘_newtab’);”, true);