Click here to Skip to main content
15,901,001 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Sir,

I am develop a web application in asp.net 2.0.How to validate a textbox inside the update panel javascript?

-Debapriya
Posted

Pure Javascript validation is almost certainly wrong in ASP.NET, it only checks on the client, not the server, and a this is insecure.

ASP.NET has validation controls built in:
MSDN Validation Controls[^]
All of these generate the JavaScript and validate on the server too (except the CustomValidator: You write the server and client scripts for yourself). The validators are:


  • RequiredFieldValidator- The validated field must not be blank
  • CompareValidator - Compares against a value, or value of another control
  • RangeValidator - Makes sure the value is in a pre-defined range
  • RegularExpressionValidator - Makes sure the value matches a regex
  • CustomValidator - Complex Validation you define yourself.
  • ValidationSummary - Allows you to summarise validation failures
 
Share this answer
 
Your question is not quite clear, but it sounds like you want to validate via JavaScript while Update Panel start working/finishes. If so, have a look at this article: How to handle before & after update panel update[^]

If it's a normal validation for a textbox via Javascript then you need to simply find the textbox control and validate the value.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900