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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:35:27+00:00 2026-06-01T18:35:27+00:00

I just want to put LogIn Status text in MY ASP master page. When

  • 0

I just want to put LogIn Status text in MY ASP master page. When User not logged IN it will show LogIn and If user already logged In it will show LogOut. Once user Clicked logOut ,session will be clear .

<asp:LoginView ID="LoginView1" runat="server" onviewchanged="LoginView1_ViewChanged">
       <AnonymousTemplate>
              <asp:LoginStatus ID="LoginStatus1" runat="server" LoginText="logIn" />
       </AnonymousTemplate>
       <LoggedInTemplate>
              <asp:LoginStatus ID="LoginStatus2" runat="server" LogoutText="loggedout"  />
       </LoggedInTemplate>
</asp:LoginView>  

I am using using System.Web.SessionState; to manage session. I can check user is login or not by using bellow code.

If (Session["logged"] == true) 

Please help me to display LogIn or logOut Status in Master page in Dynamically according to current session status. Thank you in advance.

  • 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-01T18:35:28+00:00Added an answer on June 1, 2026 at 6:35 pm

    LoginView control uses the current request’s identity to determine whether or not they are logged in, and also the principal’s role memberships, if you use the feature where you can show different templates for different roles. So, you won’t be able to achieve what you wish using LoginView. Same thing with LoginStatus.

    You can roll your own versions of those controls to do what you wish, or attempt to derive your own control from those controls and simply override the part where it figures out if you’re logged in or not.

    Alternately, you can just place something like this in your master page.

    <% if (Session["logged"] is bool && (bool)Session["logged"]) {%>
     Logged in
    %> } else { %>
     Logged out
    <% } %>
    

    However, I’d recommend you just rely on the request’s identity to determine whether or not a user is logged in. A) it’s built-in, fully supported, and you don’t have to do anything extra B) Sessions are not durable. You can access the request’s user in a page, control, etc. by accessing the User.Identity.IsAuthenticated property.

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

Sidebar

Related Questions

All I want is to make a simple user password login. I have put
I just want to retrieve the source (string) from the page after I logged
Basically I just want to put new.gif in the top left corner of the
I have two jobs on Hudson, A & B. I just want to put
I want to create a login dialog by inheriting QDialog. I put in subclass
I just want to ensure they are logged in before running any code. I
Just wondering what the best way to store user login data on successful login
I want to put a login form everywhere in my webpage so I added
I have a basic Login Screen that the tablet user will log in to,
I want to use DBMS_OUTPUT.PUT_LINE , but the number of rows exceeds just 1.

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.