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 default authentication mode for asp.net?
What is http response header?
Can you explain why it is useful to use mvc instead of webforms? : asp.net mvc
Why asp.net is better than php?
What is GAC in ASP.NET 2.0
Explain in what order a destructors is called.
What is the difference between exe and dll?
What is the importance of aspnet_isapi.dll, inetinfo.exe andaspnet_wp.exe in the page loading process.
Difference between using directive vs using statement?
Whats the difference between registerclientscriptblock, registerclientscriptinclude and registerclientscriptresource?
Explain the difference between web user control and web custom control?
What is application variable in asp.net?
How does session work in asp net?
List the events in page life cycle.
How tooltip is set through code-behind in ASP.NET?