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 is bound controls

582


What is viewstate in asp net with example?

523


How many types of validators are there in asp net?

490


Explain login control and form authentication.

557


Describe a bubbled event and how it is used ?

614






What is application variable?

515


Can the dictionary object be created in client?s scope ?

1985


Explain the difference between the web config and machine config.

623


What is round trip in asp.net?

509


Tell me how asp.net mvc differs from asp.net web forms? : asp.net mvc

547


How would you create a permanent cookie?

564


What are validators and list some validators of asp.net?

535


What is different authentication mechanisms used in ASP.NET?

582


5. What three Specific Job Positions do you target from Swatz Oils GROUP U.K?

1761


Difference between Response.redirect vs server.transfer?

583