[02/03] Loading PDF file from harddisk to web form
Dear All,
How are u?
I am working in a project with C# & ASP.NET
Now I have some pdf files in a folder and the path of the files are stored in my database.
How can I run a pdf file by giving the address from my form. That means I want to load a pdf file from my harddisk space to a web form by clicking a button or something like that.
Please help me with code if u can.
Regards,
Rajib
Re: [02/03] Loading PDF file from harddisk to web form
You're not clear. Do you want to load the PDF from your own machine to the web server, or do you want a PDF from the web server loaded from a web form?
Re: [02/03] Loading PDF file from harddisk to web form
If it's the second, use Response.Redirect(), but I still can't understand you fully.
Re: [02/03] Loading PDF file from harddisk to web form
I want to run the pdf file from my own harddisk.
If it is possible with Response.Redirect(), then please give an example.
Sorry for too late to response.
Rajib
Re: [02/03] Loading PDF file from harddisk to web form
In that case, use javascript.
Code:
document.location.href=document.getElementById('txtLocationOfPDFFile').value;
Where txtLocationOfPDFFile is a textbox where you enter the location of the PDF on your hard drive.
Re: [02/03] Loading PDF file from harddisk to web form
I am not familier with javascript. Please give an example so that I can use it.
Rajib
Re: [02/03] Loading PDF file from harddisk to web form
Uhm... I just gave you an example.