0 Replies - 464 Views - Last Post: 05 January 2016 - 09:18 PM Rate Topic: -----

#1 Nage   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 05-January 16

How to open my file in asp.net-vb.net

Posted 05 January 2016 - 09:18 PM

Hi after uploading files through upload document it display in list box from list box how to open my file. Is there an option to create hyperlink to this.Below is my code in vb.net I have another button to remove the file is it possible to open a file from list box.
Protected Sub UploadFile(ByVal sender As Object, ByVal e As System.EventArgs)
        If FileUpload1.HasFile Then
                FileUpload1.SaveAs("\\Destinationpath\testing\\" & _
                Label1.Text =
              FileUpload1.FileName & "<br>"
                'Dim files As List(Of ListItem) = New List(Of ListItem)
                'For Each filePath As String In filePaths
                '    files.Add(New ListItem(Path.GetFileName(filePath), filePath))
            Catch ex As Exception
                Label1.Text = "ERROR: " & ex.Message.ToString()
            End Try
            Label1.Text = "You have not specified a file."
        End If
    End Sub
    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs)
        Label1.Text = "File removed"
    End Sub

This post has been edited by andrewsw: 06 January 2016 - 07:44 AM
Reason for edit:: added missing [code][/code] tags

Is This A Good Question/Topic? 0
  • +

Page 1 of 1