using asp.net membership provider how to check if the user is registered or not?
-
20-08-2019 - |
Question
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"?
Solution
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;
OTHER TIPS
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)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow