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

A

Andreas Klemt

Hello,

is there a difference between

System.Web.HttpUtility.UrlEncode

and

Server.UrlEncode ?


Thanks in advance,
Andreas
 
D

Daniel Bass

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.


Hello,

is there a difference between

System.Web.HttpUtility.UrlEncode

and

Server.UrlEncode ?


Thanks in advance,
Andreas
 
M

mikeb

Andreas said:
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).
 
A

Andreas Klemt

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
 
M

mikeb

Andreas said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top