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?

Answer Posted / divakar upadhyay

You have take the validation summary and put ValidationGroup On validation summary for e.g Validationgroup="a" and Put Same ValidationGroup on Save Button and take RequiredField Validator and Set TargetControl i.e Textbox Id should be assigned to the Target Control and There is no need of validationgroup to the cancel button.
In This Way Save Button Will be Validate and Cancel Button should not be validate.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does it mean your session has timed out?

526


Do you know caching feature?

564


What are the security types in ASP/ASP.NET? Different Authentication modes?

561


What is difference between singleton and single call?

646


What is csrf attack in asp.net?

519






How do you identify that the page is postback?

541


How u refer webservices?

1494


How to create discussion forum in asp.net mvc? : Asp.Net MVC

533


Is it possible to apply themes to an asp.net application? If yes, then how?

579


Can you change a Master Page dynamically at runtime?

576


Define a web service in .net?

615


What is the maximum amount of memory any single process on windows can address?

534


List the major built-in objects in asp.net?

549


What is the use of autowireup in asp.net?

565


How do I publish my asp.net application to my isp's web server?

590