System.Web.Security.SqlRoleProvider.ApplicationName Property

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

Syntax

public override string ApplicationName { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

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

If a value is not specified for the applicationName attribute in the configuration file for the Web application, then the System.Web.HttpRequest.ApplicationPath property value for the current System.Web.HttpContext.Request object 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 SqlRoleProvider.ApplicationName property value. The SqlRoleProvider.ApplicationName property is not thread safe for multiple writes, and changing the SqlRoleProvider.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 SqlRoleProvider.ApplicationName property unless you must. An example of an application where setting the SqlRoleProvider.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