F
Fendi Baba
I customised the creare user wizard and added a Listbox on the page.
The listbox is populated by a dataset when the page is loaded. When I
try to submit i get an error. This error is due to the list box. Any
ideas why this may be so? The listbox is not added between the
CreateUserWizardStep.
this is the code in the submit button
Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
CreateUserWizard1.CreatedUser
Dim CheckBoxRoles As ListBox = _
CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("CheckBoxRoles"),
ListBox)
Dim role_indices As Integer = CheckBoxRoles.GetSelectedIndices
Dim rolesList(role_indices.Length - 1) As String
For i As Integer = 0 To rolesList.Length - 1
rolesList(i) = Me.CheckBoxRoles.SelectedItem.Value
Next
Roles.AddUserToRoles(CreateUserWizard1.UserName.ToString,
rolesList)
End Sub
The listbox is populated by a dataset when the page is loaded. When I
try to submit i get an error. This error is due to the list box. Any
ideas why this may be so? The listbox is not added between the
CreateUserWizardStep.
this is the code in the submit button
Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
CreateUserWizard1.CreatedUser
Dim CheckBoxRoles As ListBox = _
CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("CheckBoxRoles"),
ListBox)
Dim role_indices As Integer = CheckBoxRoles.GetSelectedIndices
Dim rolesList(role_indices.Length - 1) As String
For i As Integer = 0 To rolesList.Length - 1
rolesList(i) = Me.CheckBoxRoles.SelectedItem.Value
Next
Roles.AddUserToRoles(CreateUserWizard1.UserName.ToString,
rolesList)
End Sub