System.Web.Security.Roles.ApplicationName Property

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

Syntax

public static string ApplicationName { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

The Roles.ApplicationName property is used by the System.Web.Security.Roles class to associate users and roles with different applications. This enables multiple applications to use the same data source to store user and role information without running into conflicts between duplicate user names or duplicate role names. Multiple ASP.NET applications can use the same data source by specifying the same value in the Roles.ApplicationName property. You can set the Roles.ApplicationName property programmatically, or you can set it declaratively in the configuration file for the Web application by using the applicationName attribute.

If your Web application is using the System.Web.Security.SqlRoleProvider class and a value is not specified for the applicationName attribute in the configuration file, the System.Web.HttpRequest.ApplicationPath property value for the current System.Web.HttpContext.Request property is used.

Note:

Because a single default role 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 Roles.ApplicationName property value. The Roles.ApplicationName property is not thread safe for multiple writes, and changing the Roles.ApplicationName property value can result in unexpected behavior for multiple users of an application. You should avoid writing code to allow users to set the Roles.ApplicationName property, unless required. An example of an application where setting the Roles.ApplicationName property may be required is an administrative application that manages role data for multiple applications. Such an application should be a single-user application and not a Web application.

Requirements

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