Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/myscript/public_html/codes-snippets/config.php on line 6
Error Provider in C# - Csharp

Error Provider in C# - Csharp

How to use error provider in C#

Snippet Code

Rate this page :
  [ 0 votes]

Here, the code explains how to validate empty string using error provider in c#

private void txtEmptyString_Validated(object sender, EventArgs e) { bool bTest = txtEmptyStringIsValid(); if (bTest == true) { this.errorProvider1.SetError(txtEmptyString, "This field must contain text"); } else { this.errorProvider1.SetError(txtEmptyString, ""); } }


Ask Questions

Ask Question