Open a PDF file with VB.NET

the code below work fine while in the devloping environment but does nothing when the page is published and does not raise any errors any clue why?
the web server is 2003 server with IIS set up to emulate .net framework 2
 
   Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged
        Dim filename As String
        Dim path As String
        filename = "f:\webso\invoices\" + Trim(GridView1.SelectedRow.Cells(0).Text) + ".pdf"
        path = Page.ResolveClientUrl(filename)
        System.Diagnostics.Process.Start(path)
    End Sub
emizrachiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DhaestCommented:
Does your web-application have the rights for the f-drive.
Can you add a error-handler, perhaps we see an error
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged
try
        Dim filename As String
        Dim path As String
        filename = "f:\webso\invoices\" + Trim(GridView1.SelectedRow.Cells(0).Text) + ".pdf"
        path = Page.ResolveClientUrl(filename)
        System.Diagnostics.Process.Start(path)
catch ex as exception
   messagebox.show ex.tostring
end try
    End Sub

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
grayeCommented:
It's more likely that you really intended to send the pdf to the client PC to be rendered by the client's browser (rather than render it on the Web server via a Process.Start)
0
emizrachiAuthor Commented:
can you send me a code snippet for that or point me in the right direcion.
where can i find a sample code for that
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

emizrachiAuthor Commented:
Dhaest
thanks for the reply
there is an F drive and the files are there i don't get any errors from the browser it just show done on the bottom left side of the page but nothing is open.
i tried as a test to remove the files to see if an error will be triggered and it did so the files are in the right place.
0
DhaestCommented:
Do you have a popup-blocker installed ?
Do you have a pdf-reader installed ?
0
emizrachiAuthor Commented:
no popup blocker
yes PDF reader installed
0
DhaestCommented:
Can you give this a try
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged
        Dim filename As String
        Dim path As String
        filename = "f:\webso\invoices\" + Trim(GridView1.SelectedRow.Cells(0).Text) + ".pdf"
        path = Page.ResolveClientUrl(filename)
        response.redirect(path)
    End Sub

Open in new window

0
grayeCommented:
I keep wondering if the Author had intended to render the PDF on the server... or send it to the client to be rendered in the browser
0
emizrachiAuthor Commented:
at this point i don't care i would rather send to client to be open on his browser
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.