Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
You find that one of your validation is very complicated and does not fit in any of the validators, what will you do
You find that one of your validation is very complicated and does not fit in any of the validators, what will you do ?
✍: Guest
Best is to go for CustomValidators. Below is a sample code for a custom validator which checks that a textbox should not have zero value
<asp:CustomValidator id="CustomValidator1" runat="server" ErrorMessage="Number not divisible by Zero" ControlToValidate="txtNumber" OnServerValidate="ServerValidate" ClientValidationFunction="CheckZero" />
Input: <asp:TextBox id="txtNumber" runat="server" /> <script language="javascript"> <!-- function CheckZero(source, args) { int val = parseInt(args.Value, 10); if (value==0) { args.IsValid = false; } else { args.IsValid = true; } } // --> </script>
2007-10-24, 4974👍, 0💬
Popular Posts:
What is difference between custom JSP tags and JavaBeans? Custom JSP tag is a tag you defined. You d...
How To Run Stored Procedures in Debug Mode? - Oracle DBA FAQ - Introduction to Oracle SQL Developer ...
How To Display a Past Time in Days, Hours and Minutes? - MySQL FAQs - Managing Tables and Running Qu...
Why does malloc(0) return valid memory address? What's the use? malloc(0) does not return a non-NULL...
What is XSLT? XSLT is a rule based language used to transform XML documents in to other file formats...