Hello
I have the following in my aspx.vb file (it's a new user registration form on a Web site):
The code work - locally, at least - but when the user clicks the Register/Submit button he is not redirected anywhere so he doesn't know if his registration has been successful or not.
If possible I would like to introduce a piece of code that says 'if the user is successful redirect here' otherwise 'go back to the new user registration form'. I imagine that would involve a 'If....else' statement. I am just unsure how to write it exactly or where to place it in my code. Does it require another aspx page or can I include it in the code I have posted above?
Thank you.
Keymaker
I have the following in my aspx.vb file (it's a new user registration form on a Web site):
VB.NET:
Protected Sub CreateUser_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Using conn As OleDbConnection = New OleDbConnection(System.Configuration.ConfigurationManager.ConnectionStrings("students").ConnectionString)
Dim Sql As String = "INSERT INTO university (username,[password], strEmail) VALUES (@username,@password, @strEmail)"
Dim cmd As New OleDbCommand(Sql, conn)
conn.Open()
cmd.Parameters.AddWithValue("@username", username.Text)
cmd.Parameters.AddWithValue("@password", password.Text)
cmd.Parameters.AddWithValue("@strEmail", strEmail.Text)
cmd.ExecuteNonQuery()
conn.Close()
End Using
End Sub
The code work - locally, at least - but when the user clicks the Register/Submit button he is not redirected anywhere so he doesn't know if his registration has been successful or not.
If possible I would like to introduce a piece of code that says 'if the user is successful redirect here' otherwise 'go back to the new user registration form'. I imagine that would involve a 'If....else' statement. I am just unsure how to write it exactly or where to place it in my code. Does it require another aspx page or can I include it in the code I have posted above?
Thank you.
Keymaker