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

can s/w quality assurance engineer switch field to programming side i m very much interested in programming but not much good in it

1421


Define what is razor? : asp.net mvc

585


What is application Object?

595


Explain the difference between webfarm and webgardens in .net?

549


What is x xss protection?

575






What are cookies in your browser?

537


What is the difference between union and join?

565


What does mvc represent in asp.net? : asp.net mvc

528


Can the unique key be null?

572


What are the events in a page life cycle?

539


i want to implement grid view value in paypal site. so how to create this code in asp.net with C#

1414


What is server infrastructure?

617


Describe state management in asp.net?

555


What is custom attribute?

573


What is the use of web.config and machine.config files?

631