Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using asp.net membership provider how to check if the user is registered or not?

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"?

like image 598
ahmed Avatar asked Feb 01 '09 02:02

ahmed


People also ask

How do I validate my username and password in C#?

Text + "' and Password= '" + TextBoxSignPass. Text + "'"; SqlCommand cmd = new SqlCommand(checkUser, con); cmd. ExecuteNonQuery(); con. Close();

How do I use SQLMembershipProvider?

To configure SQLMembershipProvider, first you need to configure your database. Leave the default selection "Configure SQL Server for application services" and click Next again. Enter the server name, Select SQL Server authentication and enter user id and password as in the following figure.

How can I use ASP Net Membership in C#?

To create a user in our application by using ASP.NET Membership we need the following steps to complete this process. Step 1: Firstly, open visual studio, then go to File Menu and click New -> Web Site. Step 2: After open the new empty website and add a new item Login. aspx in Registration inside Solution Explorer.

How does membership GetUser work?

The GetUser method retrieves the user information from the data source and creates a MembershipUser object populated with the returned data. If you use one of the GetUser overloads that does not take a username parameter, GetUser returns the information for the current logged-on membership user.


1 Answers

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;
like image 196
Glennular Avatar answered Sep 28 '22 11:09

Glennular