ProfileManager.ApplicationName Property
Assembly: System.Web (in system.web.dll)
public: static property String^ ApplicationName { String^ get (); void set (String^ value); }
/** @property */ public static String get_ApplicationName () /** @property */ public static void set_ApplicationName (String value)
public static function get ApplicationName () : String public static function set ApplicationName (value : String)
Not applicable.
Property Value
The name of the application for which to store and retrieve profile information.The ProfileManager uses the 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 ApplicationName property. The 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 ApplicationVirtualPath property value for ASP.NET applications. For non-ASP.NET applications, the default value is the ModuleName property value, without the file extension.
The ApplicationName property exposes the 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 Providers property and access the ApplicationName property of the provider directly.
Caution: |
|---|
| Because a single default profile provider instance is used for all of the requests served by an HttpApplication object, you can have multiple requests executing concurrently and attempting to set the ApplicationName property value. The ApplicationName property is not thread safe for multiple writes, and changing the 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 ApplicationName property unless you require it. An example of an application where setting the 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. |
The following configuration file excerpt shows the profile element in the system.web section of the Web.config file for an ASP.NET application. It sets the application's default profile provider to a SqlProfileProvider instance and sets the ApplicationName to MyApplication.
<profile enabled="true" defaultProvider="SqlProvider">
<providers>
<add name="SqlProvider"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="SqlServices"
applicationName="MyApplication" />
</providers>
</profile>
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.
Caution: