Private Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
TextBox1.BackColor = Color.White
Dim temp As String
temp = TextBox1.Text
'Dim conditon As Boolean = False
If emailaddresscheck(temp) = True Then
': If emailaddresscheck(conditon) = True Then
TextBox1.BackColor = Color.Green
'MessageBox.Show("Please enter your email address correctly", "Incorrect Email Entry")
'TextBox1.Text = ""
TextBox1.BackColor = Color.Yellow
I have stopped the message cause it will never allow to enter valid email unless you copy and paste.
Also try this pattern
Dim pattern As String = "\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
If you need additional validation (checking that an email address is not already in use in your application, ..) you should use AJAX to connect back to the server and check this. You can either use raw AJAX but I advise you to use Jquery instead as it deals with the low level details of AJAX.
'yourForm' is the id of your form...I have given u directions and almost 90% of script.....Rest is on your part to include proper error class and success class in the code above and proper css for the success and error class...try to learn jquery which makes good on page events....if you learn it you can even submit the form in the same page.