Hello All,
I have requirement to rendered .HTML file into the browser and .HTML file stored in physcial file.
Same code I need to rendered .HTML file into the brower using asp.net C# 20222 solution.
Below code we rendered using PDF file same like i need to rendered in HTML file in browser.
WebClient User = new WebClient();
Byte[] FileBuffer = User.DownloadData(FilePath);
if (FileBuffer != null)
{
Response.ContentType = "application/pdf";
Response.AddHeader("content-length", FileBuffer.Length.ToString());
Response.BinaryWrite(FileBuffer);
}

Sachin SinghRank #66 · 26.2K reputationPosted Oct 3, 2023, 12:36 PM EDT
use this
protected void btn_Click(object sender, EventArgs e) { Page.ClientScript.RegisterStartupScript( this.GetType(),"OpenWindow","window.open('htmlpageurl','_newtab');",true); } OR protected void btn_Click(object sender, EventArgs e) { Response.Write(""); Response.Write("window.open('HTMLfilepath','_blank')"); Response.Write(""); }