Partial Class Registration_SchoolRegistration
Inherits System.Web.UI.Page
Protected Sub CreateUserWizard1_CreatedUser(sender As Object, e As System.EventArgs) Handles CreateUserWizard1.CreatedUser
Try
Dim UserNameTextBox As TextBox = DirectCast(CreateUserWizardStep1.ContentTemplateContainer.FindControl("UserName"), TextBox)
Dim PrincipalEmail As TextBox = DirectCast(CreateUserWizardStep1.ContentTemplateContainer.FindControl("Email"), TextBox)
Dim DataSource As SqlDataSource = DirectCast(CreateUserWizardStep1.ContentTemplateContainer.FindControl("SchoolInfo"), SqlDataSource)
DataSource.InsertParameters.Add("TimeStamp", DateTime.Now)
DataSource.InsertParameters.Add("PrincipalUserName", UserNameTextBox.Text.ToString)
DataSource.InsertParameters.Add("PrincipalEmail", PrincipalEmail.Text.ToString)
DataSource.Insert()
Catch ex As Exception
MsgBox(ex.Message.ToString)
Finally
End Try
End Sub
End Class
Given Above is the code snippet i am using to store additional data to the DB.Is there any way i can revoke the registration if anything goes wrong??
I mean suppose the data entered is not in correct format or something bad happens at the server side..i do not want the user to get registered..or say i want to DE-register the user,so that he/she can register again on the site using the same credentials.
You could delete the user if something fails:
http://forums.asp.net/t/1496773.aspx/1