I have a string that I am trying to pass from my C# app to my ASP.NET MVC 3 endpoint. This string looks like the following
(2+3=5)/20
I am using the HttpUtility.UrlEncode method to prepare the data. I’ve noticed that the resulting string looks like the following:
(2%2b3%3d5)%2f20
This value is getting passed back to an ASP.NET MVC 3 endpoint. I know that the endpoint looks like the following:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult UploadData(string data)
{
// What does "data" look like here? Does it look like (2+3=5)/20 or, (2%2b3%3d5)%2f20
}
I’m trying to understand what data will look like on the server when its passed back. If the variable on the server is used WITHOUT any manipulation, will it be (2+3=5)/20 or (2%2b3%3d5)%2f20?
Thank you!
It looks like this:
(2+3=5)/20. ASP.NET takes care of url decoding properly url encoded query string parameters.