//前端脚本
function LoginOut() { if (window.confirm("是否退出?")) { window.location.href = "/Account/loginOut"; } }
<script>
<a onclick="LoginOut()">退出</a>
</script>
后台程序
public ActionResult LoginOut() { FormsAuthentication.SignOut(); return RedirectToAction("Acount", "Login"); }