Server.HTMLEncode and the # (pound) symbol

Discussion in 'ASP .Net' started by Chris, Jul 13, 2004.

  1. Chris

    Chris Guest

    Can someone tell me why HTMLEncode doesn't convert # to %23?

    I am building a querystring and the # comes through as a #, which of
    course kills the rest of the items in the querystring.

    Any idea? Is there another function I can use? For now I just wrote
    my own to swap out any #s.
     
    Chris, Jul 13, 2004
    #1
    1. Advertising

  2. Chris

    bruce barker Guest

    query strings should not be HTML encoded, but rather URL encoded. try

    HttpUtility.UrlEncode

    -- bruce (sqlwork.com)


    "Chris" <> wrote in message
    news:...
    > Can someone tell me why HTMLEncode doesn't convert # to %23?
    >
    > I am building a querystring and the # comes through as a #, which of
    > course kills the rest of the items in the querystring.
    >
    > Any idea? Is there another function I can use? For now I just wrote
    > my own to swap out any #s.
     
    bruce barker, Jul 13, 2004
    #2
    1. Advertising

  3. Chris

    Chris Guest

    Holy crap, I can't believe that I didn't realize what I was doing.

    I knew something wasn't right... I am a disgrace :)

    Thanks!



    "bruce barker" <> wrote in message news:<#>...
    > query strings should not be HTML encoded, but rather URL encoded. try
    >
    > HttpUtility.UrlEncode
    >
    > -- bruce (sqlwork.com)
    >
    >
    > "Chris" <> wrote in message
    > news:...
    > > Can someone tell me why HTMLEncode doesn't convert # to %23?
    > >
    > > I am building a querystring and the # comes through as a #, which of
    > > course kills the rest of the items in the querystring.
    > >
    > > Any idea? Is there another function I can use? For now I just wrote
    > > my own to swap out any #s.
     
    Chris, Jul 15, 2004
    #3
    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. Victor

    HtmlEncode and Euro Symbol

    Victor, Jul 19, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    1,260
    Victor
    Jul 19, 2006
  2. quat

    string and pound symbol

    quat, Feb 5, 2006, in forum: C++
    Replies:
    3
    Views:
    386
  3. Replies:
    7
    Views:
    588
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    Jul 4, 2007
  4. MyndPhlyp
    Replies:
    3
    Views:
    501
    MyndPhlyp
    Oct 3, 2005
  5. Justin C

    PDF::Reuse & UK currency 'pound' symbol

    Justin C, Nov 29, 2007, in forum: Perl Misc
    Replies:
    1
    Views:
    181
    Ben Morrow
    Nov 29, 2007
Loading...

Share This Page