2. • Validation server controller… the name shows that it is
basically used for validation… If user forgot to enter the
data at that time we want to display the message that
“Please Enter the data” or If we have enter the wrong
value … So for this operation we used the validation
Server Controller…
• ASP.NET have some inbuilt validation server controller
like RequiredFieldValidator Server Control,
RangeValidator Server Control etc…
•
Prepared By, NicheTech, NicheTech Com.Sol.Pvt.Ltd (http://www.nichetechinstitute.com)
3. • In this presentation I have covered the required and
Range validation server controller…
Prepared By, NicheTech, NicheTech Com.Sol.Pvt.Ltd (http://www.nichetechinstitute.com)
4. • Whenever we want that in the page particular filed
should not be null, means that user should provide some
information at that time we have to make that control
required in the form using RequiredFieldValidator
control.
Prepared By, NicheTech, NicheTech Com.Sol.Pvt.Ltd (http://www.nichetechinstitute.com)
5. • Now just right click on RequiredFieldValidator1… it will
shows the property of RequiredFieldValidator1… now in
that try to find out …
Prepared By, NicheTech, NicheTech Com.Sol.Pvt.Ltd (http://www.nichetechinstitute.com)
6. • ControlToValidate… Shows that RequiredFieldValidator1
works for Textbox1
• Error Message… Shows when we forgot to enter the data
inside TextBox1.
• Now when we run the page
Prepared By,NicheTech, NicheTech Com.Sol.Pvt.Ltd (http://www.nichetechinstitute.com)
7. • If we click on the button directly without fill the data
inside the textbox it will shows us the error
• OtherWise Show us the correct out put…
Prepared By, NicheTech, NicheTech Com.Sol.Pvt.Ltd (http://www.nichetechinstitute.com)
8. • The range validate server control enables you to make
range of particular control. For giving range we have to
add minimum and maximum values. Take a look at
following images:
Prepared By, NicheTech, NicheTech Com.Sol.Pvt.Ltd (http://www.nichetechinstitute.com)
9. • Right click on Range validation1 And set the property
like…
Prepared By, NicheTech, NicheTech Com.Sol.Pvt.Ltd (http://www.nichetechinstitute.com)
10. • And it will generate following output.
Prepared By, NicheTech, NicheTech Com.Sol.Pvt.Ltd (http://www.nichetechinstitute.com)