【发布时间】:2014-11-24 06:11:58
【问题描述】:
我的字符串中有#。
我正在通过 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");
}
});
我的密码字符串是:pass@#
我的c#方法结构:
public string validateLogin(string Email, string Password)
{
return Password;
}
在c#中获取密码参数时,如下:
pass@
当我提醒
encodeURIComponent(Password)
它的:
pass%40%23
为什么我的 c# 方法中的密码参数没有得到相同的结果(pass%40%23)???
请帮帮我。
【问题讨论】:
标签: javascript c# jquery asp.net .net