What is a RequiredFieldValidator control?
The RequiredFieldValidator is a control that checks whether the value of an assigned input control is different from its initial value.To work with this control drag a RequiredFieldValidator control, Command Button and two TextBoxes from the Toolbox. The intention is to display the text entered in TextBox1 in TextBox2 when the Command Button is clicked. If there is no value in TextBox1, an error message ("Saying Textbox1 needs a value") will be spawned.
All you have to make the RequiredFieldValidator work is to open the properties of the control. Looking at two properties; ErrorMessage and ControltoValidate specifically. The ErrorMessage property should be completed with a warning that the field needs to be completed. Secondly, the ControltoValidate property is used to tag which control is to be validated.
The sample code for that is:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal_
e As System.EventArgs) Handles Button1.Click
TextBox2.Text = TextBox1.Text
End Sub
Written by Sandeep Mogulla, Webmaster at www.startvbdotnet.com
Index
Sponsored links
Villanova University Six Sigma & IT Certificate Programs
100% Online programs in Six Sigma, IS Security, CISSP Prep, Business Analysis, Proj. Mgmt. and more!
100% Online programs in Six Sigma, IS Security, CISSP Prep, Business Analysis, Proj. Mgmt. and more!
ASP.NET 3.5 Hosting on Windows 2008!
ASP.NET 3.5/2.0 Hosting on Windows 2008 & 2003! AJAX, LINQ, & Silverlight Ready! 3 Mo. Free!!
ASP.NET 3.5/2.0 Hosting on Windows 2008 & 2003! AJAX, LINQ, & Silverlight Ready! 3 Mo. Free!!
SFTP components for .NET
Add complete SSH and SFTP support to your .NET framework application
Add complete SSH and SFTP support to your .NET framework application
PureCM Software Configuration Management
Version control and integrated issue tracking - powerful and easy to use. Get your FREE trial now!
Version control and integrated issue tracking - powerful and easy to use. Get your FREE trial now!
Virtual File System SDK
Create your own file systems in Windows and .NET applications
Create your own file systems in Windows and .NET applications
