Having an issue with my querystring - I am calling a controller action using JavaScript in the following way:
if ((event >= 65) && (event <= 90) || (event >= 48) && (event <= 57)) {
var focussed = document.activeElement.id;
window.setTimeout(function () {
alert(in2.value);
location.href = "/CarSaldi/ListaArt?in1=" + in1.value + "&in2=" + in2.value + "&focus=" + focussed;
}, 1000);
}
Where 'in2' is an input text that may contain a "+", for example, "milk+chocolate". However, when calling the controller action:
public ActionResult ListaArt(string in1, string in2, string cod, string focus)
{
[...]
}
The value of string 'in2' ends up showing as "milk chocolate" instead of "milk+chocolate". It's essential to retain the "+" sign within the string.