我在我的字符串中有#
。url編碼組件不在字符串服務器端
並且我通過ajax將該字符串發送到服務器端的c#方法。
我送它,如下所示:
$.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");
}
});
我的密碼字符串是:[email protected]#
我的C#方法結構:
public string validateLogin(string Email, string Password)
{
return Password;
}
Wheni得到密碼參數在C#中,它如下:
[email protected]
當我做的
警報encodeURIComponent(Password)
把
它:
pass%40%23
爲什麼我沒有得到同樣的結果(合格%40%23)在我的C#方法的密碼參數???
Plaese幫助我。
您上一個鏈接幫了我。謝謝。 :) – 2014-11-24 08:43:20