/AnotherStartup/Account/Logout.cshtml

# · Razor · 12 lines · 11 code · 1 blank · 0 comment · 2 complexity · dda579405c6c97391a59450dbbcf401e MD5 · raw file

  1. @{
  2. // Log out of the current user context
  3. WebSecurity.Logout();
  4. // Redirect back to the homepage or return URL
  5. var returnUrl = Request.QueryString["ReturnUrl"];
  6. if (returnUrl.IsEmpty()) {
  7. Response.Redirect("~/");
  8. } else {
  9. Context.RedirectLocal(returnUrl);
  10. }
  11. }