Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

221
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!