WindowsTokenRoleProvider.ApplicationName Property

Gets or sets the name of the application.

Namespace: System.Web.Security
Assembly: System.Web (in system.web.dll)

public override string ApplicationName { get; set; }
/** @property */
public String get_ApplicationName ()

/** @property */
public void set_ApplicationName (String value)

public override function get ApplicationName () : String

public override function set ApplicationName (value : String)

Not applicable.

Property Value

The name of the application.

Exception typeCondition

HttpException

An attempt was made to set the ApplicationName property by a caller that does not have High ASP.NET hosting permission.

System.Configuration.Provider.ProviderException

An attempt was made to set the ApplicationName to a string that is longer than 256 characters.

Unlike other role providers such as the SqlRoleProvider, the WindowsTokenRoleProvider class does not associate role information with an application. Instead, the role information is taken from the Windows groups on the local computer. Multiple applications on the same server that use the WindowsTokenRoleProvider class always share the same role information. Although the applicationName can be configured in the Web.config file for the application, the ApplicationName property is not used to retrieve role information.

The following example shows the roleManager element in the system.web section of the Web.config file for an ASP.NET application. It specifies the application's WindowsTokenRoleProvider instance and sets the ApplicationName property to MyApplication.

<roleManager defaultProvider="WindowsProvider" 
  enabled="true"
  cacheRolesInCookie="false">
  <providers>
    <add
      name="WindowsProvider"
      type="System.Web.Security.WindowsTokenRoleProvider" 
      applicationName="MyApplication" />
  </providers>
</roleManager>

Windows 98, Windows Server 2000 SP4, 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.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: