RoleProviderCollection.Item[String] Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the role provider in the collection referenced by the specified provider name.
public:
property System::Web::Security::RoleProvider ^ default[System::String ^] { System::Web::Security::RoleProvider ^ get(System::String ^ name); };
public System.Web.Security.RoleProvider this[string name] { get; }
member this.Item(string) : System.Web.Security.RoleProvider
Default Public ReadOnly Property Item(name As String) As RoleProvider
Parameters
- name
- String
The name of the role provider.
Property Value
An object that inherits the RoleProvider abstract class.
Examples
The following code example accesses a SqlRoleProvider configured for an application from the Providers property of the Roles class by name.
SqlRoleProvider p = (SqlRoleProvider)Roles.Providers["SqlProvider"];
DescriptionLabel.Text = p.Description;
Dim p As SqlRoleProvider = CType(Roles.Providers("SqlProvider"), SqlRoleProvider)
DescriptionLabel.Text = p.Description
Remarks
The role providers for an application are exposed as a read-only RoleProviderCollection by the Providers property of the Roles class. You can access a specific role provider in the collection by name and cast it as the specific provider type, such as SqlRoleProvider. This enables you to manage role information from multiple data stores in a single application as well as access custom members of a role provider that are not part of the RoleProvider abstract class.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기