如何在“创建用户”向导步骤中添加角色 [英] how to add roles in Create User wizard step

查看:103
本文介绍了如何在“创建用户”向导步骤中添加角色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用创建用户向导(内置),在此向导中我还创建了一个步骤

选择你的角色。现在我想将所有角色检索到我的列表框中。我应该怎么做。

i am using Create user wizard (Built-in) , in this wizard i have also create a step for
"Choose your role". now i want to retrieve all role into me list box. what should i need to do.

listbox.dataSource = ???

推荐答案

你可以这样做:



You can do like below :

private void BindRolesToList()
{
     // Get all of the roles
     string[] roles = Roles.GetAllRoles();
     UsersRoleList.DataSource = roles;
     UsersRoleList.DataBind();
}





欲了解更多信息,请查看:



为用户分配角色 [ ^ ]



更新:使用System.Web.Security;





我希望这会对你有所帮助。



For more information check this :

Assigning Roles to Users[^]

Update : using System.Web.Security;


I hope this will help to you.


这篇关于如何在“创建用户”向导步骤中添加角色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆