System.Web.Profile.ProfileManager.ApplicationName Property

Gets or sets the name of the application for which to store and retrieve profile information.

Syntax

public static string ApplicationName { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

The System.Web.Profile.ProfileManager uses the ProfileManager.ApplicationName property to associate profile information with different applications. This enables multiple applications to use the same database to store user information without running into conflicts between duplicate users. Multiple ASP.NET applications can use the same user database by specifying the same value in the ProfileManager.ApplicationName property. The ProfileManager.ApplicationName property can be set programmatically, or it can be set declaratively in the configuration file for the Web application by using the applicationName attribute.

If a value is not specified for the applicationName attribute in the configuration file for the Web application, then the profile providers included with the .NET Framework use the System.Web.Hosting.HostingEnvironment.ApplicationVirtualPath property value for ASP.NET applications. For non-ASP.NET applications, the default value is the System.Diagnostics.ProcessModule.ModuleName property value, without the file extension.

The ProfileManager.ApplicationName property exposes the System.Configuration.SettingsProvider.ApplicationName property of the default profile provider. The default profile provider is specified using the defaultProvider attribute of the profile configuration element. If the user profile contains properties that are managed by a profile provider other than the default provider, they may be configured with a different application name. To access the application name of a profile provider other than the default provider, obtain a reference to the profile provider using the ProfileManager.Providers property and access the System.Configuration.SettingsProvider.ApplicationName property of the provider directly.

Note:

Because a single default profile provider instance is used for all of the requests served by an System.Web.HttpApplication object, you can have multiple requests executing concurrently and attempting to set the ProfileManager.ApplicationName property value. The ProfileManager.ApplicationName property is not thread safe for multiple writes, and changing the ProfileManager.ApplicationName property value can result in unexpected behavior for multiple users of an application. It is recommended that you avoid writing code that allows users to set the ProfileManager.ApplicationName property unless you require it. An example of an application where setting the ProfileManager.ApplicationName property may be required is an administrative application that manages profile data for multiple applications. Such an application should be a single-user application and not a Web application.

Requirements

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