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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:21:27+00:00 2026-05-23T20:21:27+00:00

I am working on login/signup module(FYI no rolls/membership just a simple login form),data flow

  • 0

I am working on login/signup module(FYI no rolls/membership just a simple login form),data flow is from sql server for both registeration and login,and code is currently working fine.
I am trying to use signin/signout functionality in my code. I have already created a login form and the user is able to login and after successful login, user is redirected to default_page.aspx.
my r&d code upto this is as:

<td width="122" align="right"><asp:LinkButton ID="LinkButton1" runat="server" 
            onclick="LinkButton1_Click">Sign Out</asp:LinkButton></td>

cs page:

protected void LinkButton1_Click(object sender, EventArgs e)
{
    //After click Log out we need to delete all session values


    Session.RemoveAll();
    Response.Redirect("userlogin.aspx");
}

from above code u can see I have put only a linkbutton and if user click on above link button user got sign out and redirected to loginpage(here userlogin.aspx). But now if I am trying to change(see below aspx and .cs) as signin|signout i am getting error as:‘System.Security.Principal.IPrincipal’ does not contain a definition for ‘IsAuthenticated’ and no extension method ‘IsAuthenticated’ accepting a first argument of type ‘System.Security.Principal.IPrincipal’ could be found (are you missing a using directive or an assembly reference?)

aspx page:

<td width="122" align="right"><asp:LinkButton ID="LinkButtonSignInOut" runat="server" 
            onclick="LinkButton1_Click">""</asp:LinkButton></td>

.cs page:

protected void LinkButton1_Click(object sender, EventArgs e)
{
    //After click Log out we need to delete all session values
    if (User.IsAuthenticated)**//error is here**
        LinkButtonSignInOut.Text = "Sign Out";
    else
        LabelSignInOut.Text = "Sign In"; 

    Session.RemoveAll();
    Response.Redirect("userlogin.aspx");
}

Any suggestions???

thanks!

  • 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-23T20:21:28+00:00Added an answer on May 23, 2026 at 8:21 pm

    Check the below code, I have wrote the comment

    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        if (User.IsAuthenticated) **//error is here**
        if(User.Identity.IsAuthenticated) // this is correct code
             LinkButtonSignInOut.Text = "Sign Out";
        else
            LabelSignInOut.Text = "Sign In";
    
        Session.RemoveAll(); //
        Session.Abandon(); // Better to use this
        Response.Redirect("userlogin.aspx"); 
        // You are display assigning text in label and immediate after you are redirecting it to another page ??
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was working on a Login Form ( AJAX ) enabled. When a use
I finally got my facebook login working, so I can retrieve information from a
I had a working login form for my web2py app. I don't know what
I am using the Secure module from play framework and its mostly working great.
I am working on is a website which features: user signup user login add
I am working on iPhone app with NSURLConnection api. I created Login/Signup screens and
i been working in the login code .. it works fine except this message
I am working in a Login page and teh logic is like -> try
I am working on a login system for a client and I have run
I'm working on a login page, I want the user to see his name

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.