Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HttpUtility.HtmlEncode not working

Tags:

c#

asp.net

I am trying to encode parameters to be sent to a web service for processing. I start with a command with parameters such as:

TransportProviderConfirmation/68,Akal Singh,+972544944860,1234

I pass this string to a the encoding function:

template = HttpUtility.HtmlEncode(template);

The returned string is not changed in any way, despite the fact that there is a blank space which should be turned into %20, and a plus sign which should be turned into %2B. What is happening?

like image 267
Aharon Manne Avatar asked Feb 04 '26 20:02

Aharon Manne


1 Answers

HtmlEncode? I think you're looking for UrlEncode().

like image 94
Erik Philips Avatar answered Feb 07 '26 09:02

Erik Philips



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!