In my webform I have a listbox that is populated with document names that it gathers from a folder on the server.
there are various document types excel pdf, word etc..
Can I open them in the web browser when hey are selected in the list?
I have tried


but i just get 'internet explorer cannot display the webpage'

I've also tried


but that only opens it in the background not open it to view!

If possible i would like to be able to open the file in a new page in the browser!

Thanks for any advice!!


I have managed to get files to open with


It looks like this is opening pdf files only.
it is opening it in the same window
i really want it to open in a new window!

You should try the JavaScript code.

<asp:ListBox ID="ListBox1" runat="server"

I have my listbox populated by the following vb command

 Dim TheDirectory As New IO.DirectoryInfo("Q:\Documents\BM401582")

 lbDocs.DataSource = TheDirectory.GetFiles.Select(Function(fi As IO.FileInfo) fi.Name).ToList()


will i still be able to use the code above?