Page visitors authenticated or not

2 posts, 0 answers
  1. Guenni
    Guenni avatar
    8 posts
    Member since:
    Jul 2008

    Posted 01 Oct 2008 Link to this post


    I'm working on a webpage and I'd like to know if the current visitor is anonymous or has  logged in. In need this to enable/disable some controls.

    What I'd like to reach is:

    if user=anonymous
    (not logged in)
    {disable member controls}

    if user=authenticated

    {enable member controls}

    Thanks in advance

  2. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 06 Oct 2008 Link to this post


    Not sure if you've found your answer yet, but ASP.NET provides a very simple framework for performing this exact task. Take a look at these quickstart demos on the LoginView control:

    It enables you to display different content based on roles and login/logout status. Hope that helps.

Back to Top