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

  • Thread starter Thread starter Andreas Klemt
  • Start date Start date
A

Andreas Klemt

Hello,

is there a difference between

System.Web.HttpUtility.UrlEncode

and

Server.UrlEncode ?


Thanks in advance,
Andreas
 
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
 
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).
 
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
 
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

Back
Top