Re: QueryString not translating characters correctly?

Discussion in 'ASP .Net' started by Curt_C [MVP], Jul 7, 2004.

  1. Curt_C [MVP]

    Curt_C [MVP] Guest

    dont pass the name, pass the ID, it will save you many nightmares

    --
    Curt Christianson
    Owner/Lead Developer, DF-Software
    Site: http://www.Darkfalz.com
    Blog: http://blog.Darkfalz.com


    "Chumbo" <> wrote in message
    news:...
    > Hi,
    >
    > I have an interseting situation. Our system is an ASP.NET system written

    in C#. A user can request a report and the URL passed may contain a name as
    follows:
    >
    > .aspx?name=éBC Company...
    >
    > If I encode it, it'll look like this before it's passed in:
    >
    > .aspx?name=%C3%A9BC%20Company...
    >
    > In each case, when I get the value using QueryString, it reads it as:
    >
    > éBC Company
    >
    > Here's how I read it in:
    >
    > string myVar = "";
    > if (Request.QueryString.HasKeys())
    > myVar = Request.QueryString.Get("name");
    >
    > This works fine as long none of these "strange" chracters are in the name.

    Of course, because of this problem the file cannot be read as its name is
    now changed. Any ideas? Thanks much.
    >
    Curt_C [MVP], Jul 7, 2004
    #1
    1. Advertising

  2. Curt_C [MVP]

    Curt_C [MVP] Guest

    Is this name stored in a db/file somewhere? If so by passing the ID you can
    retrieve it at time it's needed and not have to worry about URLEncoding it
    or HTMLEncoding it, just pulling and displaying as is.

    --
    Curt Christianson
    Owner/Lead Developer, DF-Software
    Site: http://www.Darkfalz.com
    Blog: http://blog.Darkfalz.com


    "Chumbo" <> wrote in message
    news:...
    > I'm not sure how that helps fix my problem. Can you elaborate please?

    Thanks.
    >
    > "Curt_C [MVP]" wrote:
    >
    > > dont pass the name, pass the ID, it will save you many nightmares
    > >
    > > --
    > > Curt Christianson
    > > Owner/Lead Developer, DF-Software
    > > Site: http://www.Darkfalz.com
    > > Blog: http://blog.Darkfalz.com
    > >
    > >
    > > "Chumbo" <> wrote in message
    > > news:...
    > > > Hi,
    > > >
    > > > I have an interseting situation. Our system is an ASP.NET system

    written
    > > in C#. A user can request a report and the URL passed may contain a name

    as
    > > follows:
    > > >
    > > > .aspx?name=éBC Company...
    > > >
    > > > If I encode it, it'll look like this before it's passed in:
    > > >
    > > > .aspx?name=%C3%A9BC%20Company...
    > > >
    > > > In each case, when I get the value using QueryString, it reads it as:
    > > >
    > > > éBC Company
    > > >
    > > > Here's how I read it in:
    > > >
    > > > string myVar = "";
    > > > if (Request.QueryString.HasKeys())
    > > > myVar = Request.QueryString.Get("name");
    > > >
    > > > This works fine as long none of these "strange" chracters are in the

    name.
    > > Of course, because of this problem the file cannot be read as its name

    is
    > > now changed. Any ideas? Thanks much.
    > > >

    > >
    > >
    > >
    Curt_C [MVP], Jul 7, 2004
    #2
    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. Mehdi
    Replies:
    6
    Views:
    36,041
    sloan
    Apr 6, 2006
  2. Andee Weir
    Replies:
    10
    Views:
    56,853
    AltaGid
    Aug 13, 2007
  3. Don Robertson

    Translating characters and enties

    Don Robertson, Jan 5, 2004, in forum: XML
    Replies:
    2
    Views:
    634
    Dimitre Novatchev
    Jan 5, 2004
  4. Henrik S. Hansen

    Translating escaped characters

    Henrik S. Hansen, Nov 1, 2004, in forum: Python
    Replies:
    2
    Views:
    280
    Henrik S. Hansen
    Nov 2, 2004
  5. Ken Fine
    Replies:
    1
    Views:
    405
    Walter Wang [MSFT]
    Jan 22, 2008
Loading...

Share This Page