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 |
Code for updating the database by entering the data into textboxes in aspx form?
Which object encapsulates state or data of a user?
What are cookies in your browser?
What is full trust in asp.net?
when using windows API in .net then it is managed code or Unmanaged code?
What does uri mean?
7. Do you have reference list?
4 Answers CMC, Hotel Jobs, Mannar Company, Qatar Petroleums, Swatz Oils,
How can you handle errors in Web API?
What are the events that happen when a client requests an asp.net page from iis server?
In order to get assembly info which namespace we should import?
What is WebService ?
8 Answers Tanla Solutions, Yahoo,
Types of session management in ASP.NET ?