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
What is an asp.net validator? And, mention its types.
What is connection pooling and how to enable and disable connection pooling?
What is the difference between the asp and asp.net?
How can you dynamically add user controls to a page?
What is master page in dtp?
What are the various session state management options provided by asp.net?
Explain program to call the js function when the change is being made in the dropdown list made in asp.net mvc? : asp.net mvc
Explain the various authentication mechanisms in asp.net.
What are query strings used for?
How can we create Tree control in asp.net?
Explain why datareader is useful?
Is asp.net different from asp? If yes, explain how?
What is the use of asp.net web api?
What are the different types of proxy patterns?
Can master pages be nested?