Subject: CreateUserWizard -access controls inside templates
Posted By: vs Post Date: 9/13/2006 9:01:36 PM
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.ContentTemplateContainer.FindControl("phone")
        
 Dim mydatasource As New SqlDataSource()
 mydatasource.ConnectionString = ConfigurationManager.ConnectionStrings("myConnectionString").ToString()
 mydatasource.InsertCommandType =SqlDataSourceCommandType.Text
 mydatasource.InsertCommand = "Insert into customer(phone) values (@phone)"
 mydatasource.InsertParameters.Add("phone", phone.Text)
    End Sub
     </script>

Go to topic 49715

Return to index page 322
Return to index page 321
Return to index page 320
Return to index page 319
Return to index page 318
Return to index page 317
Return to index page 316
Return to index page 315
Return to index page 314
Return to index page 313