Difference between System.Web.HttpUtility.UrlEncode and Server.UrlEncode?

Discussion in 'ASP .Net' started by Andreas Klemt, Jan 21, 2004.

  1. Hello,

    is there a difference between

    System.Web.HttpUtility.UrlEncode

    and

    Server.UrlEncode ?


    Thanks in advance,
    Andreas
     
    Andreas Klemt, Jan 21, 2004
    #1
    1. Advertising

  2. Andreas Klemt

    Daniel Bass Guest

    as far as i know, the latter is available in VB, and not c#.

    but they'll be the same function, but in different places for difference
    people.

    Dan.


    "Andreas Klemt" <> wrote in message
    news:...
    Hello,

    is there a difference between

    System.Web.HttpUtility.UrlEncode

    and

    Server.UrlEncode ?


    Thanks in advance,
    Andreas
     
    Daniel Bass, Jan 21, 2004
    #2
    1. Advertising

  3. Andreas Klemt

    mikeb Guest

    Andreas Klemt wrote:
    > Hello,
    >
    > is there a difference between
    >
    > System.Web.HttpUtility.UrlEncode
    >
    > and
    >
    > Server.UrlEncode ?
    >
    >
    > Thanks in advance,
    > Andreas
    >
    >


    No.

    Server.UrlEncode() calls HttpUtility.UrlEncode() to do its work. It just
    makes sure that the encoding specified in the HTTP headers
    (Response.ContentEncoding) is used (if any).

    --
    mikeb
     
    mikeb, Jan 21, 2004
    #3
  4. Hello Mikeb,
    thanks for your answer.
    But how can I find out for the furture which function is calling which
    function?
    I am working with Visual Studio .NET

    Thanks,
    Andreas

    "mikeb" <> schrieb im Newsbeitrag
    news:%...
    > Andreas Klemt wrote:
    > > Hello,
    > >
    > > is there a difference between
    > >
    > > System.Web.HttpUtility.UrlEncode
    > >
    > > and
    > >
    > > Server.UrlEncode ?
    > >
    > >
    > > Thanks in advance,
    > > Andreas
    > >
    > >

    >
    > No.
    >
    > Server.UrlEncode() calls HttpUtility.UrlEncode() to do its work. It just
    > makes sure that the encoding specified in the HTTP headers
    > (Response.ContentEncoding) is used (if any).
    >
    > --
    > mikeb
     
    Andreas Klemt, Jan 22, 2004
    #4
  5. Andreas Klemt

    mikeb Guest

    Andreas Klemt wrote:
    > Hello Mikeb,
    > thanks for your answer.
    > But how can I find out for the furture which function is calling which
    > function?
    > I am working with Visual Studio .NET


    I'm not sure what you're asking.

    Server.UrlEncode( s)

    is equivalent to

    HttpUtility.UrlEncode( s, Response.ContentEncoding)

    Basically Server.UrlEncode() is implemented as a convenience and to
    provide backward compatibility with Classic ASP.

    Call whichever one you like.

    >
    > Thanks,
    > Andreas
    >
    > "mikeb" <> schrieb im Newsbeitrag
    > news:%...
    >
    >>Andreas Klemt wrote:
    >>
    >>>Hello,
    >>>
    >>>is there a difference between
    >>>
    >>>System.Web.HttpUtility.UrlEncode
    >>>
    >>>and
    >>>
    >>>Server.UrlEncode ?
    >>>
    >>>
    >>>Thanks in advance,
    >>>Andreas
    >>>
    >>>

    >>
    >>No.
    >>
    >>Server.UrlEncode() calls HttpUtility.UrlEncode() to do its work. It just
    >>makes sure that the encoding specified in the HTTP headers
    >>(Response.ContentEncoding) is used (if any).
    >>
    >>--
    >>mikeb

    >
    >
    >



    --
    mikeb
     
    mikeb, Jan 22, 2004
    #5
    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. Marc Cardinal

    HttpUtility.UrlEncode security workaround

    Marc Cardinal, Oct 4, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    2,650
    Ken Dopierala Jr.
    Oct 4, 2004
  2. Dario Sala
    Replies:
    1
    Views:
    3,805
    Karl Seguin
    Nov 15, 2004
  3. jakk
    Replies:
    4
    Views:
    12,248
  4. CindyH
    Replies:
    1
    Views:
    625
    Alvin Bruney [ASP.NET MVP]
    May 14, 2008
  5. CindyH
    Replies:
    1
    Views:
    905
    Nanda Lella[MSFT]
    Feb 11, 2009
Loading...

Share This Page