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 8667419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:57:32+00:00 2026-06-12T17:57:32+00:00

I have the following code in my Visual Studio 2010 C# Web Application. The

  • 0

I have the following code in my Visual Studio 2010 C# Web Application. The Web application has the Windows Authentication enabled in IIS.

<script runat="server">
  void Signout_Click(object sender, EventArgs e)
  {
    FormsAuthentication.SignOut();
    Response.Redirect("WebForm1.aspx");
  }
</script>

<body>
    <form id="form1" runat="server">
    <div>
        <span class="style1"><strong>

        <asp:HyperLink ID="Link_Home" runat="server" NavigateUrl="~/WebForm1.aspx">Home</asp:HyperLink> &nbsp;|
        <asp:Button ID="Submit1" OnClick="Signout_Click" Text="Sign Out" runat="server" />

        </strong></span><br />
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>
</html>

However, I notice that the FormsAuthentication.SignOut(); seem not working. This is because when I click the button. It is suppose to logout and clear the current user so that when another user come to this page, it should prompt for password.

However, when I open another tab and enter the web application url, it did not prompt me for username or password. It is only when the web browser is close and open again with the web application url, then it prompt me for the username and password.

Appreciate if anyone can help me.

  • 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-06-12T17:57:34+00:00Added an answer on June 12, 2026 at 5:57 pm

    I used the following code to logoff and redirect to the login page.

    try {
       document.execCommand("ClearAuthenticationCache");
    }
    catch (e) { }
    window.location.replace("login.aspx");
    

    More details and Reference as following:

    1. ASP.NET Windows Authentication logout

    2. How to redirect to another webpage in JavaScript/jQuery?

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

Sidebar

Related Questions

I have added the following code in my C#.net application in visual studio 2010
I have the following code behind a button in Visual Studio 2010 private void
I have created a web application using ext.net and c# in visual studio 2010.
I have the following code in C# Visual Studio 2010. string connectionString = Provider=Microsoft.Jet.OLEDB.4.0;Data
I have the following C++ code to make dll (Visual Studio 2010). class Shape
I have Visual Studio 2010 ultimate edition. I have the following code in a
I have the following code which works in a Visual Studio 2010 WCF project.
Visual Studio C++ 2008 I have the following code in my server.h file. #if
i have following code in visual c++ #include<Windows.h> LPCTSTR Caption=LApplication programming INTERFACE; INT WINAPI
Afternoon All, I am using a visual studio 2010. I have a web page

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.