I have # in my string.
and i am sending that string to my c# method on server side through ajax.
I am sending it as follows:
$.ajax({
type: "POST",
url: "http://localhost:5889/MobileEcomm/Service1.svc/validateLogin/"+EmailID+"/"+encodeURIComponent(Password),
crossDomain: true,
success: function (data) {
alert(JSON.stringify(data));
alert("Login Sucessfull!!!");
window.location = "viewOrders.html";
// do something with server response data
},
error: function (err) {
// handle your error logic here
alert("Error");
}
});
my Password string is : pass@#
My c# method structure:
public string validateLogin(string Email, string Password)
{
return Password;
}
Wheni get password parameter in c#, Its as follows:
pass@
When i make alert of
encodeURIComponent(Password)
Its:
pass%40%23
Why i am not getting same result (pass%40%23) as a parameter for password in my c# method???
Plaese help me.