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
How does the service stream content?
Explain cashing in asp.net.
What is the use of data set in asp.net?
What does asp.net stand for?
How to find last error which occurred?
Explain method to handle error using HttpError in Web API?
Explain the various authentication mechanisms in asp.net.
Why mvc is better than asp.net? : Asp.Net MVC
What is the meaning of TestApi?
What are directives in asp.net? List down all the important directives.
Describe the difference between inline and code behind - which is best in a?
Should I delete cookies?
What is .net framework and what are the main components of it?
Is post back in asp.net?
What do you mean by role-based security?