Broken Link

M

Mel

My link does not work. I want to create a link to a file that exists
on a different server. The path to the file is this "\\Junebug\Groups
\90000003.pdf". My web server is "10.10.1.111". How do I get this
link to work?

When I hover over the link the path looks like this:
http://10.10.1.111/\\Juno\Groups\90000003.pdf
 
P

Peter Bromberg [C# MVP]

For this you would need to use the FILE:/// moniker, not "Http://
--Peter
 
M

Mel

For this you would need to use the FILE:/// moniker, not "Http://

Okay thanks. I had the IT guy create a virtual directory on the
server. Your idea is better though, I'll check it out.
 
M

Mel

For this you would need to use the FILE:/// moniker, not "Http://

Okay so I created my virtual directory. Why doesn't DirectoryInfo
work (see code below)? The "Quote-Docs" is my new virtual directory
on my web server. I get an error that it could not find part of the
path and it is trying to query the C:\ drive.

If e.CommandName = "Quote #" Then
Dim currentCommand As String = e.CommandName
Dim currentRowIndex As Integer =
Int32.Parse(e.CommandArgument)
Dim strQuoteNum As String =
gvQuotes.DataKeys(currentRowIndex).Value

Dim myDir As DirectoryInfo = New DirectoryInfo("~\Quote-
Docs\" & strQuoteNum)
dgQuote.DataSource = myDir.GetFiles("*.pdf")
dgQuote.DataBind()
End If
 
M

Mel

Okay so I created my virtual directory. Why doesn't DirectoryInfo
work (see code below)? The "Quote-Docs" is my new virtual directory
on my web server. I get an error that it could not find part of the
path and it is trying to query the C:\ drive.

If e.CommandName = "Quote #" Then
Dim currentCommand As String = e.CommandName
Dim currentRowIndex As Integer =
Int32.Parse(e.CommandArgument)
Dim strQuoteNum As String =
gvQuotes.DataKeys(currentRowIndex).Value

Dim myDir As DirectoryInfo = New DirectoryInfo("~\Quote-
Docs\" & strQuoteNum)
dgQuote.DataSource = myDir.GetFiles("*.pdf")
dgQuote.DataBind()
End If

I got it. I just wrapped the path with Server.MapPath.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top