Createuserwizard trouble

magnetica

Member
Joined
Aug 25, 2006
Messages
6
Programming Experience
Beginner
I have edited the createuserwizard to have some extra textboxes, dropdownlists etc

I wish to get the values of these objects.. I use the code below to retrieve it and test to see if i have the correct value by outputting it into a Msgbox!

I have also tried the code that is commented out but when i do either of the two i get the same error. I dont understand this as its the same code as finding a control within a LoginView or any container..

This is the code i am using
//BEGIN

Protected Sub Button2_Click1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click


' ' 'Dim user as String = CType(CreateUserWizard1.FindControl("UserName"), TextBox).Text

' ' 'Msgbox(user)

MsgBox(CType(CreateUserWizard1.FindControl("UserName"), TextBox).Text)

End Sub

//END

Just to prove this works with the Login View below is the code i would use to get the text property of a textbox within a login view:

//BEGIN
CType(LoginView.FindControl("TextBox1"), TextBox).Text
/END

TO HELP YOU UNDERSTAND WHAT IM TRYING TO DO HERE A A FEW PICTURES:

This is a picture of my control:
cuwpicry9.jpg


Now for now i am just trying to get the text property out of ScreenName because once i do this i will be able to do it for the rest.

Here is a picture of my error:

cuwprobyc4.jpg


This is the error i get which doesn't really make sense to me. But i guess it says that it cant find the control (let me know if this is incorrest)

Please help as im sure there is a very simple solution but have been trying to figure it out now for over an hour..

Your help is appreciated...

Thanks
 
Actually, this is ASP.Net, and you have posted in VB.Net.

anyhow, try this...
VB.NET:
msgbox(Ctype(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("UserName"),Textbox).Text)
 
Thank you 'jwh' for the help! Very much aprreciated..
Also this was posted in the ASP forum



It was actually posted in both, but seeing as jwh had already replied to your other thread in the vb.net forum i deleted the duplicate and moved this to the ASP.Net forum. Please try to ensure that you post in the most realvent forum in the future.
 
Back
Top