How do I get the current user without call Membership.GetUser()? I don’t want to call this method because it makes a round-trip to the database.
I tried Page.User, but this doesn’t return a MembershipUser object.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
If you just need the user’s username, then just call
User.Identity.Name. If you need other information about theMembershipUser, then you’ll can’t avoid that trip to database (unless as CResults pointed out, store the object in session).