Export (0) Print
Expand All

MembershipProvider.FindUsersByEmail Method

Gets a collection of membership users where the e-mail address contains the specified e-mail address to match.

Namespace:  System.Web.Security
Assembly:  System.Web.ApplicationServices (in System.Web.ApplicationServices.dll)

public abstract MembershipUserCollection FindUsersByEmail(
	string emailToMatch,
	int pageIndex,
	int pageSize,
	out int totalRecords
)

Parameters

emailToMatch
Type: System.String

The e-mail address to search for.

pageIndex
Type: System.Int32

The index of the page of results to return. pageIndex is zero-based.

pageSize
Type: System.Int32

The size of the page of results to return.

totalRecords
Type: System.Int32

The total number of matched users.

Return Value

Type: System.Web.Security.MembershipUserCollection
A MembershipUserCollection collection that contains a page of pageSize MembershipUser objects beginning at the page specified by pageIndex.

FindUsersByEmail returns a list of membership users where the user's e-mail address matches the supplied emailToMatch for the configured ApplicationName property. If your data source supports additional search capabilities, such as wildcard characters, you can provide more extensive search capabilities for e-mail addresses.

The results returned by FindUsersByEmail are constrained by the pageIndex and pageSize parameters. The pageSize parameter identifies the number of MembershipUser objects to return in the MembershipUserCollection collection. The pageIndex parameter identifies which page of results to return where 0 identifies the first page. The totalRecords parameter is an out parameter that is set to the total number of membership users that matched the emailToMatch value. For example, if 13 users were found where emailToMatch matched part of or the entire e-mail address, and the pageIndex value was 1 with a pageSize of 5, then the MembershipUserCollection would contain the sixth through the tenth users returned. totalRecords would be set to 13.

For an example of a MembershipProvider implementation, see Implementing a Profile Provider.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft