How do you use a custom validator? When might you want to
use one?
Answer Posted / pallavi
Field: <asp:textbox id="textbox1" runat="server">
<asp:CustomValidator id="valCustom" runat="server"
ControlToValidate="textbox1"
ClientValidationFunction="ClientValidate"
OnServerValidate="ServerValidate"
ErrorMessage="*This box is not valid" dispaly="dynamic">*
</asp:CustomValidator>
ClientValidationFunction is usually a javascript funtion included in the html to the user. OnServerValidate is the function that is server-side to check for validation if client does not support client-side validation.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the difference between table and query?
What is the function of the ViewState property?
Why the javascript validation not run on the asp.net button but run successfully on the html button?
In Code-Behind class which kind of code (server or client) is found ?
What is the difference between user control an custom control?
Describe how passport authentication works.
How to create multi language website in asp.net mvc? : Asp.Net MVC
Explain how is a property designated as read-only?
What is comparevalidator?
What is css and what is it used for?
Is a dll file an executable?
What are the Types of chaching. How to implement caching
Explain page output caching?
Do you know using sql cache invalidation?
What is the difference between dynamic SGA and static SGA?