Export (0) Print
Expand All

RoleServiceManager Class

Configures the location of a custom implementation of the role service.

System::Object
  System.Web.UI::RoleServiceManager

Namespace:  System.Web.UI
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)

public ref class RoleServiceManager

The RoleServiceManager type exposes the following members.

  NameDescription
Public methodRoleServiceManagerInitializes a new instance of the RoleServiceManager class.
Top

  NameDescription
Public propertyLoadRolesGets or sets a value that indicates whether the list of roles for the currently logged-on user must be retrieved.
Public propertyPathGets or sets the path of the role service.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

The RoleServiceManager class corresponds to the RoleService property of the ScriptManager or ScriptManagerProxy control.

The role Web service is used by AJAX-enabled applications to retrieve role information for the current authenticated user by using an asynchronous Web service call. You can use RoleServiceManager to provide the path of an alternative implementation of the role Web service instead of using the built-in Web service.

To use the role service in your application, you must enable it in the configuration file and declare it in the page. If you use the built-in role Web service, you have to enable it, but you do not have to explicitly declare the role service manager in the page.

To create a custom role service, you must implement a Web service that has two methods: GetRolesForCurrentUser and IsCurrentUserInRole. These methods must have the same signature as the corresponding methods of the built-in role Web service.

The following example shows the basic class structure that must be implemented in a custom role Web service class.

No code example is currently available or this language may not be supported.

To use a custom role Web service, you can add the service declaratively in markup by putting a RoleService element inside the ScriptManager control, as shown in the following example.

<asp:ScriptManager ID="SM1" runat="server">
  <RoleService Path="MyRoleService.asmx" LoadRoles="true" />
</asp:ScriptManager>

You can also programmatically set the Path property to use a custom role Web service.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft