Response.Redirect("????.aspx")

  • Thread starter Thread starter anna
  • Start date Start date
A

anna

I am trying to redirect to a page to open word/excel document. The
trick is that I don't know the path. I have a grid where the user
selects the document to open, and based on that selection, the app
should redirect and open the document. As you can see from the code
below, PATH is the value selected from the grid. The code obviously
works if I put an actual path ( i.e. c:\test\test.doc) in quotes("").
How do I make the response.redirect to read the path and redirect? I
think the problem is that it needs the path in quotes, but if I add
the quotes to the Path value, it errors out. Any ideas?

path = e.Item.Cells(2).Text ‘'' example c:\test\word.doc

If (e.CommandName = "Select") Then
Response.Redirect(Path)
End If
 
In IIS create a virtual path pointing to the root folder of your documents.
Then add a hyperlink control to the cell of the grids row with its
navigateURL property set to the virtual path (i.e. /test/word.doc).

That should solve your problem.

-Demetri
 
Back
Top