MembershipProvider user id

Posted by niao on Stack Overflow See other posts from Stack Overflow or by niao
Published on 2010-04-17T19:13:17Z Indexed on 2010/04/17 19:23 UTC
Read the original article Hit count: 460

Greetings, I wrote a custom MembershipProvider for my asp.net mvc application. I get the user as follows:

public override MembershipUser GetUser(string username, bool userIsOnline)
    {
        using (CPersistanceManager pm = new CPersistanceManager())
        {
            pm.EnsureConnectionOpen();
            MembershipUser membershipUser = null;
            COperator oper = pm.OperatorRepository.Get(username);
            membershipUser = new MembershipUser(ApplicationName,
                                               oper.Username,
                                               oper.ROWGUID,
                                               oper.Email,
                                               string.Empty,
                                               string.Empty,
                                               oper.IsActive,
                                               false,
                                               DateTime.Today,
                                               DateTime.Today,
                                               DateTime.Today,
                                               DateTime.Today,
                                               DateTime.Today
                                                );
            return membershipUser;
        }
    }

how can I then retrieve logged user id (rowguid) in any controller?

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about membershipprovider