SPUtility.FormatAccountName method (String)

Retrieves a concatenated string containing the provider and user values in order, separated by a colon (":"). This method retrieves the concatenated string based only on the user name.

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public static string FormatAccountName(
	string user


Type: System.String

A string providing the name of the user.

Return value

Type: System.String
A concatenation of the provider and user strings, in order, separated by a colon (":").

This method calls the FormatAccountName(String, String) method, passing it the Membership.Provider.Name value for the first parameter. That method validates provider and user values before concatenating the strings. If either of the provider or user values is empty or null, the ArgumentNullException exception is thrown. If the provider string contains a colon (":"), the ArgumentException exception is thrown.