The GetAllRoles method calls the RoleProvider.GetAllRoles method of the default role provider to get a list of all the roles from the data source for an application. Only the roles for the application that is specified in the ApplicationName property are retrieved.
The following code example uses the GetAllRoles method to get the list of roles for an application and bind the results to a System.Web.UI.WebControls.GridView control. For an example of a Web.config file that enables role management, see Roles.
This example contains a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see Script Exploits Overview.