Server.HTMLEncode and the # (pound) symbol

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

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.
 
query strings should not be HTML encoded, but rather URL encoded. try

HttpUtility.UrlEncode

-- bruce (sqlwork.com)
 
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!
 
Back
Top