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, 5203👍, 0💬
Popular Posts:
Can Java object be locked down for exclusive use by a given thread? Yes. You can lock an object by p...
.NET INTERVIEW QUESTIONS - Is versioning applicable to private assemblies? Versioning concept is onl...
Can Java object be locked down for exclusive use by a given thread? Yes. You can lock an object by p...
What is the purpose of the wait(), notify(), and notifyAll() methods? The wait(),notify(), and notif...
Can event’s have access modifiers ? Event’s are always public as they are meant to serve every one r...