Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

error provider c#

private void textBox1_Validating(object sender, System.ComponentModel.CancelEventArgs e)  
{  
    ValidateName();  
}  
private bool ValidateName()  
{  
    bool bStatus = true;  
    if (textBox1.Text == "")  
    {  
        errorProvider1.SetError(textBox1, "Please enter your Name");  
        bStatus = false;  
    }  
    else  
        errorProvider1.SetError(textBox1, "");  
    return bStatus;  
}  
Source by www.c-sharpcorner.com #
 
PREVIOUS NEXT
Tagged: #error #provider
ADD COMMENT
Topic
Name
8+5 =