how to hide error message after validating

Posted by Shanky11 under C# on 3/1/2013 | Points: 10 | Views : 1127 | Status : [Member] | Replies : 2
i have a contact form several input box
let's say textbox 1
here on validating event i have written this code
Private Sub TextBox1_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtuserName.Validating
If (String.IsNullOrEmpty(txtuserName.Text)) Then
ContactFormErrorProvider.SetError(txtuserName, "Enter Your Name!")
Else
here what i hve to write for?????????????????????????????????????if user enter something in this box
End If




Responses

Posted by: Satyapriyanayak on: 3/1/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
If (String.IsNullOrEmpty(txtuserName.Text)) Then
ErrorProvider1.SetError(txtuserName, "Enter Your Name!")
Else
ErrorProvider1.Clear()

End If



If this post helps you mark it as answer
Thanks


If this post helps you mark it as answer
Thanks

Shanky11, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shanky11 on: 3/1/2013 [Member] Starter | Points: 25

Up
0
Down
this is ok but on error blink
error message is not showing how can this be show

Shanky11, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response