![]() ![]() Here one Error Provider Control can be used for multiple fields. MessageBox.Show( “Data Successfully Added”) ĮrrorProvider1.SetError(txtname, “Text Missing”) ĮrrorProvider1.Clear() // Clear all Error MessagesĮrrorProvider1.SetError(txtage, “Enter Valid Age”) ĭouble j = Convert.ToDouble(txtsalary.Text) ĮrrorProvider1.SetError(txtsalary, “Enter Valid Salary”) Private void ADD_Click( object sender, EventArgs e) In ADD button click you need to write the following code. And you set the distance to the control errorProvider1. But in Case of C# windows application this feature is not available so we use Error Provider control to do any type of validation. But the choice is only left or right of the control and the alignment top, middle, bottom. You will need to set the DataSource property of the ErrorProvider to the same BindingSource used in the control's binding. In ASP.Net 2.0 we use different Validation controls from Toolbox for validations (Just Drag & Drop, No need of writing code in C#). Parameters: C ErrorProvider GetError() has the following parameters: control - The item to get. The regular ErrorProvider supports validation of databound properties by implementing IDataErrorInfo on your bound object. The ErrorProvider control is used to validate the data entered by a user. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |