HOWTO: Refer to LoginStatus control contents in the LoginView cont

Discussion in 'ASP .Net' started by Guest, Jul 24, 2006.

  1. Guest

    Guest Guest

    How do you get a reference to the LoginStatus control contained in the
    LoginView control that resides on web.master?

    I need to determine if the LoginStatus will show a LogOut link(for a logged
    in user), or show nothing at all (in the case of the user not logged in);

    Are there any other Membership properties that I can call that tell if the
    user has already authenticated.?
    Guest, Jul 24, 2006
    1. Advertisements

  2. Guest

    Guest Guest

    Isn't there an IsAuthenticated property on the User object?
    Guest, Jul 24, 2006
    1. Advertisements

  3. Guest

    Guest Guest

    Thanks. I don't know how I overlooked that.

    The purpose for trying to do this is to declare Windows Authentication on
    IIS Directory Security in order to get Request.ServerVariables("LOGON_USER")
    to pass the NT Login Name, and to declare Forms Authentication in the website
    web.config file in order to use the Membership functionality that's built in.
    The last piece to figure out is to allow a NT Logged In user to not have to
    enter a user name and password to get to the site; they've already logged in
    to their workstation when they came to work in the morning.

    The Login Control on Login.aspx has style="display:none" and I immediately
    do a client-side javascript Login button click which fires the OnAuthenticate
    event where I can set e.Authenticated to true - this sets up all the
    background authentication. On the initial visit to the site, I do a
    Membership.CreateUser (I have the username from
    Request.ServerVariables("LOGON_USER") from which I can also build an email
    address, and can set everyone's password to a constant), and a
    Roles.AddUserToRole, and persist the authentication cookie. Subsequent visits
    bypass the Login.aspx due to the auth cookie and go directly to the Home page.

    .... a lot of rigmarole to get an effect.

    Thank you kindly,

    Dan Sikorsky BA, BSCE, MCS
    Guest, Jul 25, 2006
  4. Guest

    Guest Guest

    Guest, Jul 25, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.