Hash Symbol Link problems

Discussion in 'ASP .Net' started by ree32@hotmail.com, Aug 3, 2005.

  1. Guest

    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?
     
    , Aug 3, 2005
    #1
    1. Advertising

  2. Guest

    > 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

    > 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?
    >
     
    , Aug 3, 2005
    #2
    1. Advertising

  3. Guest

    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.

    wrote:

    > <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?
    > >
     
    , Aug 4, 2005
    #3
  4. Guest

    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.
    >
    > wrote:
    >
    >> <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?
    >>>
     
    , Aug 4, 2005
    #4
  5. Guest

    Good thats what I wanted to here.

    wrote:

    > # Is an invalid charachter when nameing files used on the web.
    >
     
    , Aug 7, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. baumann@pan
    Replies:
    1
    Views:
    763
    Richard Bos
    Apr 15, 2005
  2. rp
    Replies:
    1
    Views:
    563
    red floyd
    Nov 10, 2011
  3. Song Ma
    Replies:
    2
    Views:
    251
    Charles Oliver Nutter
    Jul 20, 2008
  4. Srijayanth Sridhar
    Replies:
    19
    Views:
    658
    David A. Black
    Jul 2, 2008
  5. Replies:
    6
    Views:
    1,982
Loading...

Share This Page