Server.HTMLEncode and the # (pound) symbol

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.
 
B

bruce barker

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

HttpUtility.UrlEncode

-- bruce (sqlwork.com)
 
C

Chris

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!
 

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,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top