Here is the entire method to read the selection of the user and open up that path:
Expand|Select|Wrap|Line Numbers
- Sub Grid_CartCommand(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)
- 'the path to the documents folder
- Dim path As String = (New TILHelper).Path
- 'file name
- Dim file As String = e.Item.Cells(1).Text
- Dim extension As String = Nothing
- If e.CommandSource.text = "DOC" Then
- extension = ".doc"
- Else : extension = ".pdf"
- End If
- Dim full As String = path + file + extension
- If My.Computer.FileSystem.FileExists(full) = False Then
- Javascript.Alert("The format you specified does not exist for this document", Me)
- Else
- 'Process.Start(full)
- Response.Redirect(full, True)
- End If
- End Sub
Any help is greatly appreciated.