MembershipUser inside partial class

2 posts, 0 answers
  1. Pawel
    Pawel avatar
    2 posts
    Member since:
    Feb 2011

    Posted 05 Sep 2011 Link to this post

    Hey, is there possibility to create MembershipUser class inside partial class of model ?
    public partial class User
        {
            [Transient]
            public MembershipUser _user = Membership.GetUser();
     
            public User()
            {
            }
               public Guid GetGUID()
            {            
                return (Guid)_user.ProviderUserKey;
            }
        }
    Because I got at bold line this error

    "Object reference not set to an instance of an object."

  2. Pawel
    Pawel avatar
    2 posts
    Member since:
    Feb 2011

    Posted 05 Sep 2011 Link to this post

    Ok problem solve, I just forget that my session was end...and I wasn't on my account.
  3. DevCraft banner
Back to Top