F
Fendi Baba
i used the example in the MSDN to getroles and assign users to it on
my local development plat form and it worked flawlessly, When I move
the same code production, the rolesListbox does not get poplated. What
differences in the two environment can cuase this? What can I do to
overwrite this GetAllroles routine so that I can be assured I can get
the roles in the current application?
Here is the code, any insight will be much appreciated.
Dim rolesArray() As String
Dim users As MembershipUserCollection
Dim usersInRole() As String
Public Sub Page_Load()
Msg.Text = ""
If Not IsPostBack Then
' Bind roles to ListBox.
rolesArray = Roles.GetAllRoles()
RolesListBox.DataSource = rolesArray
RolesListBox.DataBind()
' Bind users to ListBox.
users = Membership.GetAllUsers()
UsersListBox.DataSource = users
UsersListBox.DataBind()
End If
If Not RolesListBox.SelectedItem Is Nothing Then
' Show users in role. Bind user list to GridView.
usersInRole =
Roles.GetUsersInRole(RolesListBox.SelectedItem.Value)
UsersInRoleGrid.DataSource = usersInRole
UsersInRoleGrid.DataBind()
End If
End Sub
my local development plat form and it worked flawlessly, When I move
the same code production, the rolesListbox does not get poplated. What
differences in the two environment can cuase this? What can I do to
overwrite this GetAllroles routine so that I can be assured I can get
the roles in the current application?
Here is the code, any insight will be much appreciated.
Dim rolesArray() As String
Dim users As MembershipUserCollection
Dim usersInRole() As String
Public Sub Page_Load()
Msg.Text = ""
If Not IsPostBack Then
' Bind roles to ListBox.
rolesArray = Roles.GetAllRoles()
RolesListBox.DataSource = rolesArray
RolesListBox.DataBind()
' Bind users to ListBox.
users = Membership.GetAllUsers()
UsersListBox.DataSource = users
UsersListBox.DataBind()
End If
If Not RolesListBox.SelectedItem Is Nothing Then
' Show users in role. Bind user list to GridView.
usersInRole =
Roles.GetUsersInRole(RolesListBox.SelectedItem.Value)
UsersInRoleGrid.DataSource = usersInRole
UsersInRoleGrid.DataBind()
End If
End Sub