Zdravím potřeboval bych pomoci s opravou tohoto code je pro starší verzi .NET a neustále mi to hlásí chybu v UserSettings Stávající cerze již tuto funkci pravděpodobně nezná a neustále hlásí chybu
Protected Sub RegisterUser_ActiveStepChanged(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles RegisterUser.ActiveStepChanged
'Have we JUST reached the Complete step?
If RegisterUser.ActiveStep.Title = "Complete" Then
' Automatically register the new User as a Member. The account still will not be validated until
' an Administrator approves the account.
Roles.AddUserToRole(RegisterUser.UserName, "users")
' Programmatically reference the TextBox controls
Dim LastName As TextBox = CType(UserSettings.FindControl("txtLastName"), TextBox)
Dim FirstName As TextBox = CType(UserSettings.FindControl("txtFirstName"), TextBox)
Dim Street As TextBox = CType(UserSettings.FindControl("txtStreet"), TextBox)
Dim HouseNumber As TextBox = CType(UserSettings.FindControl("txtHouseNumber"), TextBox)
Dim Adress As TextBox = CType(UserSettings.FindControl("Adress"), TextBox)
Dim PostalCode As TextBox = CType(UserSettings.FindControl("PostalCode"), TextBox)
Dim TelNumber As TextBox = CType(UserSettings.FindControl("txtTelNumber"), TextBox)
Dim FaxNumber As TextBox = CType(UserSettings.FindControl("txtFaxNumber"), TextBox)
Dim MobilNumber As TextBox = CType(UserSettings.FindControl("txtMobilNumber"), TextBox)
Dim IcqNumber As TextBox = CType(UserSettings.FindControl("txtIcqNumber"), TextBox)
' Create an empty Profile for the newly created User.
Dim p As ProfileCommon = ProfileCommon.Create(RegisterUser.UserName, True)
' Populate the Profile properties from the CreateUserWizard.
p.LastName = LastName.Text()
p.FirstName = FirstName.Text()
p.Street = Street.Text
p.HouseNumber = HouseNumber.Text
p.Adress = Adress.Text
p.PostalCode = PostalCode.Text
p.TelNumber = TelNumber.Text
p.FaxNumber = FaxNumber.Text
p.MobilNumber = MobilNumber.Text
p.IcqNumber = IcqNumber.Text
' Save the profile. This must be done since we explicitly created it.
p.Save()
End If
End Sub
|