注销:
控制器:
public ActionResult LoginOut()// 注销
{
Session.Clear();
return Json(true, JsonRequestBehavior.AllowGet);// 注销
}
源代码:
- 注销
JavaScript:
$("#LoginOut").click(function () {
if (window.confirm(“确定要注销吗?”)) {
$.post("/Main/LoginOut", function (msg) {
location.reload();
});
}
});