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

  • Home
  • SEARCH
  • 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 147567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:48:15+00:00 2026-05-11T08:48:15+00:00

Here is the situation: User logs in via username/password stored in an MSSQL database

  • 0

Here is the situation:

  1. User logs in via username/password stored in an MSSQL database
  2. If the user is authenticated, the system makes a session variable with username/SHA1’d password and boolean if the user is logged in or not (for subsequent pages)
  3. I need to be able to destroy the session variable. I want a confirmation box as well.

This is what I have so far:

<script type='text/javascript'>     //<![CDATA[     function doLogout() {         try {             var conf = false;             conf = confirm('Really log out?');             if (conf === true) {                 $.post('logout.aspx');             }         } catch (ex) {             alert(ex);         }     }     //]]> </script> 

Since it is an ajax request won’t reload the page (the functionality works fine, the request destroys the session), I think I need a different approach to do this. I would really like to be able to do it all in ASP.NET if possible.

Any solution is welcome, as long as #3 above is fulfilled.

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-11T08:48:15+00:00Added an answer on May 11, 2026 at 8:48 am

    Well, for starters your solution depends on the user having Javascript, if they don’t they won’t be able to logout. I don’t think you should be using AJAX for this, just a simple link/button to logout.aspx would be fine, that could then correctly redirect them to the homepage with the ‘logged-out’ state set. You could then use some unobtrusive Javascript to add the confirmation.

    jQuery version (since you mentioned that):

    <a href='logout.aspx' id='logout-link'>Logout</a> <script type='text/javascript'>     //<![CDATA[     $(document).ready(function() {         $('#logout-link').click(function () {             return confirm('Really log out?');         });     });     //]]> </script> 

    pure-Javascript version:

    <a href='logout.aspx' id='logout-link'>Logout</a> <script type='text/javascript'> //<![CDATA[ window.onload = function() {      if(!document.getElementById) return;      document.getElementById('logout-link').onclick(function() {          return confirm('Really log out?');     }); } //]]> </script> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my situation. I have two tables: pledges and pledge_transactions. When a user makes
I have a situation here there are two models User,Posts Now I want to
I have faced a very strange situation here. I am accessing database (MDB) through
Here's the situation. Multi-million user website. Each user's page has a message section. Anyone
Here's the situation: i have a SearchPage where an user can make a complex
Here's my situation. I have a user table and a password_reset table which references
Here's the situation, I created 6 pages,each of which has some text fields.I stored
Here my situation : The user click on a LinkButton, and the page does
Here is my situation. I have multiple user controls in a canvas. This canvas
okay, here's the situation: <div> <a href=.. id=..></a> //similarly multiple links </div> when user

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.