views:

2287

answers:

2

using asp.net and c# membership provider how to check if the user is registered or not? I want to handle this in code not by using "login status"?

+4  A: 

Not sure if you want to know if they are a "registered" user or have logged in (as the Login status would indicate)

Here's to know if they are logged in (what the Login status uses):

System.Web.HttpContext.Current.User.Identity.IsAuthenticated;
Glennular
thanks man , yes I was not clear in my question sorry, and your solution works fine :)
ahmed
+2  A: 
MembershipProvider.GetUser(string username, bool updateLastActivityDateTime)

This will get you the user, or return null of the user does not exist (has not been registered)

Rex M