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

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

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. Navanith
    Replies:
    2
    Views:
    5,576
    Navanith
    Dec 30, 2003
  2. Mehdi
    Replies:
    6
    Views:
    36,753
    sloan
    Apr 6, 2006
  3. Andee Weir
    Replies:
    10
    Views:
    62,559
    AltaGid
    Aug 13, 2007
  4. Don Robertson

    Translating characters and enties

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

    Translating escaped characters

    Henrik S. Hansen, Nov 1, 2004, in forum: Python
    Replies:
    2
    Views:
    381
    Henrik S. Hansen
    Nov 2, 2004
  6. Fister
    Replies:
    7
    Views:
    4,445
    Bergamot
    Jan 13, 2008
  7. Ken Fine
    Replies:
    1
    Views:
    488
    Walter Wang [MSFT]
    Jan 22, 2008
  8. Adeel Ahmad
    Replies:
    1
    Views:
    784
    Anthony Jones
    Mar 7, 2006
Loading...