How do you use a custom validator? When might you want to
use one?
Answers were Sorted based on User's Feedback
Answer / sravanthi kilari
Insert Custom Validator Control and then write the custom
function. If Other Validation Controls did't meet our
requirement then we will go to Custom Validator Control.
Is This Answer Correct ? | 4 Yes | 1 No |
Answer / 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 |
Answer / santosh bind
when using the complex validation like text should not contain the max 50 char
protected void cusCustom_ServerValidate(object sender, ServerValidateEventArgs e)
{
if(e.Value.Length == 10)
e.IsValid = true;
else
e.IsValid = false;
}
Is This Answer Correct ? | 0 Yes | 0 No |
What is viewstate?
6 Answers Abacus, Microsoft, Sopra,
How do cookies work?
I have a textbox , assign required field validator and i have two buttons 1) save 2) cancel , i want the validator run only when i click save button, don't validate cancel button , what to do?
7 Answers eMids, Infotech, Integra, TCS, Wipro,
How do you relate an aspx page with its code behind Page?
What is Bundling and Minification in MVC?
When during the page processing cycle is ViewState available?
What is the difference between rest and restful?
Asp.Net Source :- In my project i have gridview control - item template. Its have asp:button control. my requirement is while click this button i need to display some alert message. Could you please help me which gridview event i need to write source code? Please give me a quick response. Thanks
what is wwf in asp.net?
What is localization and Globalization?
How to change the form layout in ASp.net 2.0 ?
What type of code (server or client) is found in a Code-Behind class?