System.Web.Security.SqlMembershipProvider.GetUser Method

Returns information from the SQL Server membership database for a user and provides an option to update the last activity date/time stamp for the user.

Syntax

public override MembershipUser GetUser (string username, bool userIsOnline)

Parameters

username
The name of the user to get information for.
userIsOnline
true to update the last activity date/time stamp for the user; false to return user information without updating the last activity date/time stamp for the user.

Returns

A System.Web.Security.MembershipUser object representing the specified user. If no user is found in the database for the specified username value, null is returned.

Remarks

This method is called by the System.Web.Security.Membership class to retrieve user information from the SQL Server database specified in the ASP.NET application's configuration file (Web.config).

If userIsOnline is true, the last activity date/time stamp for the user is updated to the current date and time. This is reflected in the MembershipUser.LastActivityDate and MembershipUser.IsOnline properties and in the value returned by SqlMembershipProvider.GetNumberOfUsersOnline.

Leading and trailing spaces are trimmed from the username parameter value.

Requirements

Namespace: System.Web.Security
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0