SimpleMembershipProvider.GetUser Method (Object, Boolean)

Returns information about the user account using the specified user ID, and optionally updates the timestamp of the most recent activity for the user account.

Namespace:  WebMatrix.WebData
Assembly:  WebMatrix.WebData (in WebMatrix.WebData.dll)

public override MembershipUser GetUser(
	Object providerUserKey,
	bool userIsOnline


Type: System.Object
The ID for the user account to get information for. The ID is a Int32 value that is stored as an Object instance.
Type: System.Boolean
true to update the last-activity timestamp for the user account, or false to return user account information without updating the timestamp.

Return Value

Type: System.Web.Security.MembershipUser
An object that is populated with the user account information, or null if providerUserKey is not found.


If the SimpleMembershipProvider class has been initialized using a call to the WebSecurity.InitializeDatabaseConnection() method, this method is not supported and will throw a NotSupportedException exception. However, if the WebSecurity.InitializeDatabaseConnection() method has not been called, and if you have configured your site to use the standard ASP.NET membership provider, this method is passed through to the standard membership provider. For more information, see the SimpleMembershipProvider class overview.

  • Medium trust for the immediate caller. This member can be used by partially trusted code.