How do you use a custom validator? When might you want to
use one?

Answers were Sorted based on User's Feedback



How do you use a custom validator? When might you want to use one?..

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

How do you use a custom validator? When might you want to use one?..

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

How do you use a custom validator? When might you want to use one?..

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

Post New Answer

More ASP.NET Interview Questions

What is asynchronous call?

0 Answers  


Explain the difference between web user control and web custom control?

0 Answers  


Describe the .net base class library.

0 Answers  


What is the Difference between Web.config and global.asax? Can we write connection String code in global.asax?

10 Answers   Microsystems,


What is mvc in angular?

0 Answers  






Explain the code Access Security (CAS) in .net Framework?

0 Answers  


Explain < @OutputCache% > and the usage of VaryByParam, VaryByHeader ?

1 Answers  


What property is used on the datatable to indicate a conflict after an update? a) HasConflict b) HasError c) HasCollision d) HasDataError

1 Answers   Syntax Softtech,


Explain what is an abstract class?

0 Answers  


.net allows which inheritence

6 Answers   AG Technologies, Samcomm,


Define state managenent?Descibe state managenent technique which maintain the information at server site focusing it IDS features and limitations?

1 Answers  


What is difference between ASP and ASP.NET ?

3 Answers   TCS,


Categories