By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,105 Members | 2,560 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,105 IT Pros & Developers. It's quick & easy.

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

P: n/a
Hello,

is there a difference between

System.Web.HttpUtility.UrlEncode

and

Server.UrlEncode ?
Thanks in advance,
Andreas
Nov 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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" <ak******@hotmail.com> wrote in message
news:eV**************@TK2MSFTNGP12.phx.gbl...
Hello,

is there a difference between

System.Web.HttpUtility.UrlEncode

and

Server.UrlEncode ?
Thanks in advance,
Andreas

Nov 18 '05 #2

P: n/a
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
Nov 18 '05 #3

P: n/a
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" <ma************@mailnull.com> schrieb im Newsbeitrag
news:%2****************@TK2MSFTNGP11.phx.gbl...
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

Nov 18 '05 #4

P: n/a
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" <ma************@mailnull.com> schrieb im Newsbeitrag
news:%2****************@TK2MSFTNGP11.phx.gbl...
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
Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.