rogaut1
asked on
Validating event not being fired
I am using an error provider to validate a text box, my problem is the event is not being raised when I go to another field, why ?
Here is my code:
private void txtUserId_Validating(objec t sender, System.ComponentModel.Canc elEventArg s e )
{
string error = null;
MessageBox.Show("What !");
if ( this.txtUserId.Text.Length == 0 )
{
error = "The userid is a mandatory field, please enter a userid.";
e.Cancel = true;
}
this.errorProvider1.SetErr or((Contro l) sender,error);
}
Here is my code:
private void txtUserId_Validating(objec
{
string error = null;
MessageBox.Show("What !");
if ( this.txtUserId.Text.Length
{
error = "The userid is a mandatory field, please enter a userid.";
e.Cancel = true;
}
this.errorProvider1.SetErr
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That was the problem ! Thank you....the book I was reading never specified subcribing to the event.....
Thanks !
Robert
Thanks !
Robert
ASKER