I hope someone can help me with this. I am trying to open a pdf file in my asp.net application using c#. When I run it on my PC with Visual Studio, it works fine. When I try to run it on the server the pdf file is not opening.
here is the code below:
this code is written in button click.
Response.Write("<script>window.open('Pdfgenerator.aspx?id=" + txtPatientid.Text + "&fi=" + caseid + "_BillReport" + ".pdf ','_blank')</script>");
This code is written in
Pdfgenerator.aspx
where the pdf should be open.
string id = Request.QueryString["id"].ToString();
string cs = Request.QueryString["fi"].ToString();
Response.Clear();
Response.ContentType = "Application/PDF";
Response.WriteFile("pdfs/" + id + "/"+id+"_"+cs);
Response.Flush();
Response.Close();
thanks
parithi