ProfileBase::Create Method (String^)
Used by ASP.NET to create an instance of a profile for the specified user name.
Assembly: System.Web (in System.Web.dll)
Parameters
- username
-
Type:
System::String^
The name of the user to create a profile for.
Return Value
Type: System.Web.Profile::ProfileBase^An ProfileBase that represents the profile for the specified user.
| Exception | Condition |
|---|---|
| System.Configuration.Provider::ProviderException | The enabled attribute of the section of the Web.config file is false. |
| HttpException | The current hosting permission level is less than Medium. |
| System.Configuration::ConfigurationErrorsException | A property type specified in the section of the Web.config file could not be created. -or- The allowAnonymous attribute for a property in the section of the Web.config file is set to true and the enabled attribute of the element is set to false. -or- The serializeAs attribute for a property in the section of the Web.config file is set to Binary and the IsSerializable property of the specified type returns false. -or- The name of a provider specified using the provider attribute of a profile property could not be found in the Providers collection. -or- The type specified for a profile property could not be found. -or- A profile property was specified with a name that matches a property name on the base class specified in the inherits attribute of the section. |
The Create method creates and initializes a new profile instance and is useful for applications that use a custom profile object or manage user profiles in a non-ASP.NET environment.
This overload of the Create method assumes that the specified user name is an authenticated user.
Available since 2.0