Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6171383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:12:13+00:00 2026-05-23T23:12:13+00:00

I have some javascript that should log a user out after a certain period

  • 0

I have some javascript that should log a user out after a certain period of inactive time.

I have an event handler in the code behind that handles the normal LoggingOut event of the LoginStatus object, but I can’t figure out how to call it from my javascript.

I know you can use __doPostBack to call an event handler that handles the Click event of a link or button, but it doesn’t seem to work for my LoginStatus object – I’m thinking it might be because it has no Click event (here’s the doc) – it’s not really a normal link/button.

The only other way I can think of to handle this is to create an actual logout button/link, write another event handler that does the same thing as my LoginStatus event handler, and call this new one using __doPostBack – but I don’t really like this idea.

Is there any way I can call the LoggingOut event handler from my javascript?

The page:

// html
<asp:LoginStatus ID="loginstatus" runat="server" />
...
// js
function expireSession() {
    __doPostBack('loginstatus', ''); // doesn't seem to work
}

The code behind:

Protected Sub loginstatus_LoggingOut(ByVal sender...) Handles loginstatus.LoggingOut
    Logout() // this is my own logout sub
End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T23:12:14+00:00Added an answer on May 23, 2026 at 11:12 pm

    I’d suggest you take a different tact.

    Create a “logout” page that simply clears the cookies/session/whatever and redirects the user to a regular login page. When the timer has elapsed do a javascript redirect to your logout page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a javascript function (function1) that checks some global variables (can the user
I have a div that, when the mouse over event occurs should fire some
I have some javascript that I'm trying to retool using jQuery to learn the
I have some jQuery/JavaScript code that I want to run only when there is
I have problem in some JavaScript that I am writing where the Switch statement
I have a view using a master page that contains some javascript that needs
I have some code in a javascript file that needs to send queries back
I need to have some information about the scoping in JavaScript. I know that
I have the following Javascript function that should return an array of groups that
I have a html component that includes some javascript. The component is a file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.