I have an asp.net page with a hyperlink tag, the idea is that I want to be able to click on the hyperlink (which will have the address of a directory on the system) and be able to open up the directory.
My hyperlink tag is within a gridview and the code for it looks like this:
<asp:HyperLink ID="eFileHyper" runat="server" Text='<%#Bind("hyperlink")%>' NavigateUrl='<%#Bind("hyperlink")%>' Target="_blank"></asp:HyperLink>
I have some code in the back end that adds "file:///" to the start of the address, like this:
Dim dr As DataRow
Dim dt As DataTable
dt = CType(Session("newEFileTable"), DataTable)
dr("lastUpdated") = Now
dr("hyperlink") = "file:///" & hyperLink.Text
dt.Rows.Add(dr)
' Update session table
Session("newEFileTable") = dt
' update gridview - This binds the Session to the gridview
BindEFileData()
If I enter in a directory like this \\server\directory\subdirectory it appears as - file:/// \\server\directory\subdirectory and it works fine.
If I enter a directory as C:/directory/subdirectory it appears as file:///c:/directory/subdirectory but clicking on it does nothing.
Why would one of these work but the other doesn't?
Update The \\server\directory\subdirectory and C:/directory/subdirectory are unrelated. The C:/ one is of course local, the other one is an address to a file on the server.