Hash Symbol Link problems

R

ree32

I am having problems displaying links with # in the filenames.

When it is clicked it doesn't show.

I have tried converting the # to %23 and still no luck.

Tried server.urlEncode and still no luck.

Is there a way around this or is just # the url killer?
 
T

Tom.PesterDELETETHISSS

I have tried converting the # to %23 and still no luck.

Are you sure? Cause that works for me.

Remember that a # in a url is used to refere to anchors like in index.html#top

So an url like index.html?r=pas#id has pas as its value for r and says to
the browser to go to the section id once that page is rendered.

I tested the following code and it works for me :


<a href="destfile.aspx?r=<%=Server.Urlencode("ezra#zaer")%>">destfile.aspx</a>

In the destfile.aspx I wrote this :

<%Response.Write(Request["r"]);%>

And the value printed is ezra#zaers

I hope it helps...


Cheers,
Tom Pester
 
R

ree32

Try renaming a file with a # syumbol inside.

Then add a link to it in a html page and try opening it by clicking the
link.

MS IE says it cannot find the resource.

<a href="destfile.aspx?r=<%=Server.Urlencode("ezra#zaer")%>">destfile.aspx</a>

In the destfile.aspx I wrote this :

<%Response.Write(Request["r"]);%>

And the value printed is ezra#zaers

I hope it helps...


Cheers,
Tom Pester
I am having problems displaying links with # in the filenames.

When it is clicked it doesn't show.
Tried server.urlEncode and still no luck.

Is there a way around this or is just # the url killer?
 
T

Tom.PesterDELETETHISSS

Remember that a # in a url is used to refer to anchors like in index.html#top

So if you have file name report#bug.aspx than the browser will send a request
for the file "report" and look for an anchor bug.aspx which is nonsens of
course.

# Is an invalid charachter when nameing files used on the web.


Cheers,
Tom Pester
Try renaming a file with a # syumbol inside.

Then add a link to it in a html page and try opening it by clicking
the link.

MS IE says it cannot find the resource.

<a
href="destfile.aspx?r=<%=Server.Urlencode("ezra#zaer")%>">destfile.as
px</a>

In the destfile.aspx I wrote this :

<%Response.Write(Request["r"]);%>

And the value printed is ezra#zaers

I hope it helps...

Cheers,
Tom Pester
I am having problems displaying links with # in the filenames.

When it is clicked it doesn't show.

Tried server.urlEncode and still no luck.

Is there a way around this or is just # the url killer?
 

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,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top