hyperlinks works with IE but not with Netscape

E

Eric

Hi,

i made dynamically hyperlinks for each file in directory "mydir":

fileEntries = Directory.GetFiles(Server.MapPath("~/mydir/"))
For Each fileName In fileEntries
Dim hl As New HyperLink
hl.NavigateUrl = fileName.Substring(Server.MapPath("~/").Length)
....
Next fileName


This works perfectly with IE7 but not with Netscape/Firefox.

With IE, when putting the mouse on the link, i read in the status bar: http://myserver/myapps/mydir/myfile.aspx
With Netscape, i read: http://myserver/myapps/mydir\myfile.aspx

When clicking on it with Netscape, i see in the addressbar of the browser: http://lmyserver/myapps/mydir\L0386\myfile.aspx
=> BAD REQUEST

Thanks for help
Eric
 
B

bruce barker

Bug in your code, "\" is not valid in a url. IE will automatically
switch "\" to "/", but other browsers won't and iis doesn't either. your
server code should do the replacement be setting the url.

-- bruce (sqlwork.com)
 
E

Eric

thanks

bruce barker said:
Bug in your code, "\" is not valid in a url. IE will automatically switch
"\" to "/", but other browsers won't and iis doesn't either. your server
code should do the replacement be setting the url.

-- bruce (sqlwork.com)
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top