System.IO.StreamReader sr = new System.IO.StreamReader(Server.MapPath(strheadlinesid1));
string line;
while (sr.Peek() != -1)
{
line = sr.ReadLine();
Response.Write("<tr>"+"<td>"+ Server.HtmlEncode(line) + "</td>"+"</tr>");
}
I’m using the above code to read a file .But this is only reading .txt files properly(Not reading .doc,docx and .rtf properly). And Can anybody tell how to read .pdf files in web browser like opening in a adobe reader in a new tab.Thank you
To download a PDF file call this code with your pdf file: Depending on the user’s settings for their browser, it may open in a new tab as you want.