Try below code.
I have made some changes in it. You need to render a dynamic HtmlAnchor and place the link of it in Literal rather then placing a open/save dialog box.
In aspx add one Literal control.
<asp:Literal ID="ltrPdfLink" runat="server"></asp:Literal>
Replace your code with below one. You need to modify some parameters in below function as per your requirement like
VirtualFilePath.
public void ProcessRequest(HttpContext context)
{
string exfile = "";
String sfilepath = context.Server.MapPath("pdf");
string pdffile = sfilepath + "//" + "cat.pdf";
System.IO.FileInfo objFileInfo = new System.IO.FileInfo(exfile);
System.IO.FileStream oStream = null;
String strNewfilename = "Newname_ABC" + objFileInfo.Extension;
string VirtualFilePath = "http://yoursite/yourfolder/";
if (objFileInfo.Exists)
{
ltrPdfLink.Text = "<a href=\\" + VirtualFilePath + pdffile + ">Click here for PDF</a>";
}
}
You can place below line to open pdf in new window.
ltrPdfLink.Text = "<a target='_blank' href=\\" + VirtualFilePath + pdffile + ">Click here for PDF</a>";
Hope it helps.