Skip to main content

val

RequiredFieldValidator

This is one of the important controls used in majority of web applications. If a user fails to enter the required information on the form then the message given on this validation control will appear thereby forcing the user to fill up the required information. The code given below will illustrate this concept in detail


Name:




Age:   



I have placed two textboxes and the required number of RequiredFieldValidator controls. The message given along with the ErrorMessage property will be displayed if the user doesn't enters any data on to the relevant text boxes (See the Figure given below)

Figure 1

Comments

Popular posts from this blog

Drawing Line Charts In asp.net

LineChart.cs import the following namespaces using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.Collections; public class LineChart { public Bitmap Bitmapb; public string strTitle = "Default Title"; public ArrayList ArrayListchartValues = new ArrayList(); public float ftXorigin = 0, ftYorigin = 0; public float ftScaleX, ftScaleY; public float ftXdivs = 2, ftYdivs = 2; private int intWidth, intHeight; private Graphics Graphicsg; private Page Pagep; struct datapoint { public float ftx; public float fty; public bool bolvalid; } //initialize public LineChart(int intmyWidth, int intmyHeight, Page myPage) { intWidth = intmyWidth; intHeight = intmyHeight; ftScaleX = intmyWidth; ftScaleY = intmyHeight; Bitmapb = new Bitmap(intmyWidth, intmyHeight); Graphicsg = Graphics.FromImage(Bitmapb); Pagep = myPage; } pu...