我在登录页面中使用 jquery,在这里我需要捕获电子邮件 ID 和密码并存储在会话中以在其他页面中使用。如何使用 jquery 存储在会话中输入的值。
我的代码
$.ajax({
type: "POST",
async: false,
dataType: "json",
contentType: "application/json; charset=utf-8",
url: "home.aspx/ValidateUser",
data: (JSON.stringify({ emailid: strEmail, password: strPassword })),
success: function (responseText) {
var IsUserExists = responseText.d
switch (IsUserExists) {
case "0":
alert("Your are not registered user. Please register yours before login.");
break;
case "1":
LoginToUserProfile(strEmail, strPassword);
break;
case "2":
alert("Please activate your account from you registered email and then try to login.");
break;
}
},
error: function (responseText) {
alert("Error in validation --->" + responseText);
}
});
return false;
}
function LoginToUserProfile(strEmail, strPassword) {
$.ajax({
type: "POST",
async: false,
dataType: "json",
contentType: "application/json; charset=utf-8",
url: "home.aspx/GetUserId",
data: (JSON.stringify({ emailid: strEmail, password: strPassword })),
success: function (responseText) {
var UserId = responseText.d
window.location = "users/userhomepage.aspx?userid=" + UserId;
},
error: function (responseText) {
alert("Error in LoginToUserProfile --->" + responseText);
}
});
return false;
}
如何从 login.help 我在会话中存储电子邮件 ID 和密码的值