Re: Special Characters in Query String



Kim Bach Petersen wrote:

> SMG wrote:
>
> > But when I have special characters like [ABC&D] then the value
> > retrieved is wrong it just retrieves ABC and not complete ID [ABC&D]
> > value to be passed : ABC&D
> > http://localhost/myProj/abc.aspx?ScripID=ABC&D
> >
> > how do I overcome this, I know I can do it like we have %20 for
> > space and like wise for & there will be something, but this will be
> > a major change to my application, can I do this at one end some
> > where in web.config or in aspx page?
>
> You have to UrlEncode the string you are passing as a querystring:
>
> strQuery = HttpUtility.UrlEncode(strQuery,
> System.Text.Encoding.Default)

I suggest using a more web-friendly encoding than some Windows specific
default, e.g. ISO-8859-1 or UTF-8.

Cheers,
--
http://www.joergjooss.de
mailto:news-reply@xxxxxxxxxxxxx
.



Relevant Pages

  • Re: XP versus 98 query
    ... > XP has all but overcome these old issues.. ... > NOT an improved Windows 98.. ... Prev by Date: ...
    (microsoft.public.windowsxp.general)
  • Re: Printing prn files
    ... I think I may overcome my underlying problem by setting a Print Area in Excel. ... Windows does not provide a way to do this directly. ... > is to use a command issued from a command processor prompt. ...
    (microsoft.public.windowsxp.print_fax)
  • Re: looking for evidence to support using macs
    ... I don't need to prove anything, just to overcome the usual myths about Macs and I'd like to do it in a way that will not make friends into enemies. ... No-one has come up with any evidence that Windows boxes would be cheaper overall, all they have done is repeated the 'macs are expensive' mantra. ... Most of the equipment will be in remote places, so call-outs will not just cost more, breakdowns will be a fsckin nuisance. ...
    (comp.sys.mac.advocacy)
  • Re: Linux-powered handhelds, Ipods, mini-TIVOs, etc.
    ... There may be some hurdles to overcome in getting systems ... bootstrapped, but beyond that point, some of the "user expectations" ... WAY greater than are the case for Windows. ... If it's crap, I sure won't be paying for it... ...
    (comp.lang.php)
  • Re: Modem issues and XP
    ... > The people think the Constitution protects their rights;> But government sees it as an obstacle to be overcome. ... > | still no luck. ... Do you think if I do a Windows Repair> | install it might help? ...
    (microsoft.public.windowsxp.hardware)

Loading