How to open file(doc or pdf) in browser for an event in code behind. - DOTNET
This is a discussion on How to open file(doc or pdf) in browser for an event in code behind. - DOTNET ; In one of our requirements for our project we have a
screen which will display a list of file in a dropdown
list and after selecting a file from the dropdown and
clicking the submit button it must open the ...
-
How to open file(doc or pdf) in browser for an event in code behind.
In one of our requirements for our project we have a
screen which will display a list of file in a dropdown
list and after selecting a file from the dropdown and
clicking the submit button it must open the requested file
in the browser. Types of files are .doc or .pdf.
I trying to open the file in the click even of the button
using the response.redirect. It is working well for .doc
files, but the it is not working for pdf files, it says
the file is damaged.
The same file is working (file is opened in the browser)
when i am writing the same code in the page load event of
the page.
how do i display the file. or is there some other method
for the same.
-
Re: How to open file(doc or pdf) in browser for an event in code behind.
"JA" <anonymous@discussions.microsoft.com> wrote in message
news:0b2201c3a1fc$05d0daf0$a601280a@phx.gbl...
> In one of our requirements for our project we have a
> screen which will display a list of file in a dropdown
> list and after selecting a file from the dropdown and
> clicking the submit button it must open the requested file
> in the browser. Types of files are .doc or .pdf.
>
> I trying to open the file in the click even of the button
> using the response.redirect. It is working well for .doc
> files, but the it is not working for pdf files, it says
> the file is damaged.
>
> The same file is working (file is opened in the browser)
> when i am writing the same code in the page load event of
> the page.
>
> how do i display the file. or is there some other method
> for the same.
Please tell us what type of project you are attempting and in which
language?
The next question would be: to what are you redirecting the response in the
case of a .pdf file? In the case of a .doc file, does MS Word open?
--
Peter - [MVP - Academic]
-
Re: How to open file(doc or pdf) in browser for an event in code behind.
"JA" <anonymous@discussions.microsoft.com> wrote in message
news:0b2201c3a1fc$05d0daf0$a601280a@phx.gbl...
> In one of our requirements for our project we have a
> screen which will display a list of file in a dropdown
> list and after selecting a file from the dropdown and
> clicking the submit button it must open the requested file
> in the browser. Types of files are .doc or .pdf.
>
> I trying to open the file in the click even of the button
> using the response.redirect. It is working well for .doc
> files, but the it is not working for pdf files, it says
> the file is damaged.
>
> The same file is working (file is opened in the browser)
> when i am writing the same code in the page load event of
> the page.
>
> how do i display the file. or is there some other method
> for the same.
Please excuse my previous. On rereading your subject line, I see this is an
ASP.NET project.
Can you provide more detail on the error message you are getting when you
select a .pdf file?
I just tried this:
Response.Redirect(http://localhost/Redirect/3000.pdf)
in a VB ASP.NET project to open a .pdf file placed in the project folder,
and it's working as advertised. Are you sure you got the URL correct?
Peter - [MVP - Academic]
Similar Threads
-
By Application Development in forum PHP
Replies: 9
Last Post: 11-16-2007, 05:36 PM
-
By Application Development in forum Editors
Replies: 5
Last Post: 10-22-2007, 07:53 PM
-
By Application Development in forum Javascript
Replies: 4
Last Post: 05-02-2007, 02:30 AM
-
By Application Development in forum Adobe Acrobat
Replies: 0
Last Post: 01-22-2007, 10:02 AM
-
By Application Development in forum Inetserver
Replies: 5
Last Post: 10-06-2003, 01:08 PM