注销

function ClearSession() {
$.ajax({
type:
"get",
url:
"/Main/Logout.aspx",
data:
"clear=true",
success: function(msg) {
if (msg != null) {
if (msg == 'true') {
alert(
'成功注销该用户!');
location.href
= '/IndexTransferPage.aspx';
return true;
}
}
return false;
}
})
}

<input type="button" class="button_gray_s" value="注销" onclick="ClearSession();" style="cursor: hand; border:0px" />

Logout.aspx页面
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["clear"] != null) {
if (Request.QueryString["clear"].ToLower().Trim() == "true")
{
Session.Abandon();
Response.Write(
"true");
Response.End();
}
else {
Response.Write(
"false");
}
}
}
posted @ 2011-03-29 14:34  syy-燕子  阅读(143)  评论(0编辑  收藏  举报