This topic is locked

assigning a unc reference

8/12/2004 18:21:18
ASPRunnerPro General questions
A
apscnjohnnie author

I have read the other posts that are similiar to what I want to do but I don't want to ref an http but a unc (\\computername\sharename\datafield)
I think this is the area in my ..list.asp that needs to be modified.
<%

if IsBinaryField(rs.Fields("Folder Name")) or Format("Folder Name")=FORMAT_DATABASE_FILE then

Response.Write CreateImageControl(rs, "Folder Name", "")

else

Response.Write ProcessLargeText(GetData(rs.Fields("Folder Name"), ""))

end if

%>
so that instead of just returning the folder name value it would return the unc path to that value
Thanks for any assistance

Johnnie

Sergey Kornilov admin 8/28/2004

Johnnie,
you can try something like this:

<%

Response.Write "<a href=""" & rs.Fields("Folder Name") & """>" & rs.Fields("Folder Name") & "</a>"

%>


I hope this helps.

A
apscnjohnnie author 8/28/2004

Great that got me the hyperlink I wanted but of course to the current directory of the asp directory of that web directory. So say now I want to specify that all calls to href records in that column should be preceeded by a path of http:\\ servername.domainname\sharename or \\servername\sharename. How would I do that. Do I insert that path instead of teh """ section.

Sergey Kornilov admin 8/30/2004

Hi,
try you can try something like this:

<%

Response.Write "<a href=""\\servername\sharename\" & rs.Fields("Folder Name") & """>" & rs.Fields("Folder Name") & "</a>"

%>

A
apscnjohnnie author 8/30/2004

That worked great, sorry for my ignorance in all this, but I have one more question. What would be the syntax if I wanted to open it up in a new page so that my database page stays up and the user doesn't have to hit the back button to return to the database. I know you can right click on the link and say open in new window but I would rather have it open in a new window automatically.
Thanks for helping this very newbie out.

Sergey Kornilov admin 8/31/2004

Hi,
no problem, this one is also an easy fix:

<%

Response.Write "<a target=_blank href=""\\servername\sharename\" & rs.Fields("Folder Name") & """>" & rs.Fields("Folder Name") & "</a>"

%>