主にWebMatrix2で提供されるテンプレートに基づいてアプリケーションを作成しています。
ヘッダーに「ログアウト」リンクを作成する際に問題が発生していますが、すべてが正常に機能しています。
現在、私は次のリンクを持っています:
<a href="~/account/logout.cshtml">Sign Out</a>
次に、このページに移動します。
@{
WebSecurity.RequireAuthenticatedUser();
if (IsPost) {
// Verify the request was submitted by the user
AntiForgery.Validate();
// Log out of the current user context
WebSecurity.Logout();
// Redirect back to the return URL or homepage
var returnUrl = Request.QueryString["ReturnUrl"];
Context.RedirectLocal(returnUrl);
} else {
Response.Redirect("~/");
}
}
しかし、このリンクをクリックしても何も起こらず、まだログインしています。どこが間違っているのでしょうか。