Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

223
Vistas
Automatic Logout in ASP.NET using JS showing Error

I have tried to logout from a session by calling a C# action but it shows an error logout not found

take a look at it,

Controller Action:

[Authorize]
[HttpPost]
public ActionResult Logout()
{
    Session.Clear();
    FormsAuthentication.SignOut();
    return RedirectToAction("Index", "Home");
}

I have used a simple Javascript to automate this after 5 seconds JS:

<script type="text/javascript">
        window.setTimeout(function(){
            window.location.href = '@Url.Action("Logout", "Home", FormMethod.Post)';
        }, 5000);
    </script>

But the compiler is showing this error:enter image description here

The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /Home/Logout
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda