CreateUserWizard -access controls inside templates
Hi I Customized create user wizard by adding field Phone
Now I trying to access controls inside templated Create User wizard step1
And send Phone to customer table which I created, but it doesnât work
This is my code, any idea what is wrong. Thank you.
<script runat="server">
Sub CreateUserWizard1_CreatedUser(ByVal Sender As Object, ByVal E As EventArgs)
Dim phone As TextBox
phone = CreateUserWizard1.CreateUserStep.ContentTemplateCo ntainer.FindControl("phone")
Dim mydatasource As New SqlDataSource()
mydatasource.ConnectionString = ConfigurationManager.ConnectionStrings("myConnecti onString").ToString()
mydatasource.InsertCommandType =SqlDataSourceCommandType.Text
mydatasource.InsertCommand = "Insert into customer(phone) values (@phone)"
mydatasource.InsertParameters.Add("phone", phone.Text)
End Sub
</script>
|