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?

Answers were Sorted based on User's Feedback



I have a textbox , assign required field validator and i have two buttons 1) save 2) cancel , i wa..

Answer / kuldeep kumar

Use property CauseValidation="false" for the Cancel Button

Is This Answer Correct ?    87 Yes 9 No

I have a textbox , assign required field validator and i have two buttons 1) save 2) cancel , i wa..

Answer / jiten patel

Set Cause Validation="false"

Is This Answer Correct ?    34 Yes 6 No

I have a textbox , assign required field validator and i have two buttons 1) save 2) cancel , i wa..

Answer / lakshmi

set cause validation property to false

Is This Answer Correct ?    12 Yes 5 No

I have a textbox , assign required field validator and i have two buttons 1) save 2) cancel , i wa..

Answer / sneha gupta

set validationGroup = 'Save' for save button and textbox
but leave it blank for cancel button.

Is This Answer Correct ?    7 Yes 3 No

I have a textbox , assign required field validator and i have two buttons 1) save 2) cancel , i wa..

Answer / minakshi

set VlidationGroup property of validator.

Is This Answer Correct ?    14 Yes 13 No

I have a textbox , assign required field validator and i have two buttons 1) save 2) cancel , i wa..

Answer / 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

I have a textbox , assign required field validator and i have two buttons 1) save 2) cancel , i wa..

Answer / smit sisodia

set validation control="false" of cancel button

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More ASP.NET Interview Questions

Can One website be made using two different languages like c#,vb.net etc......

4 Answers   ABC,


14. What are your Future Plans for Swatz Oils GROUP U.K?

0 Answers   CSC, Swatz Oils, TCS,


Which object is used to encapsulate the state of the client and the browser in ASP.NET?

0 Answers   Sans Pareil IT Services,


How does Garbage collector(GC) works in .net

14 Answers   Accenture, HCL, Kekran Mekran, People Tech, Wipro,


When maintaining session through Sql server, what is the impact of Read and Write operation on Session objects? will performance degrade..

3 Answers   Allsec Technologies,






What is s2s tracking?

0 Answers  


What is Virtual path in ASP.Net

2 Answers   Proteans,


How many types of cookies are available in asp?

0 Answers  


What is the differances between a abstract calss and interface

2 Answers   Patni,


what is the jit? what is the type of jit and purpose of it>

2 Answers   Honeywell,


What is difference between asp state management and asp.net state management? How can we pass info between 2 asp.net pages?

0 Answers  


what is view state and its use

10 Answers   DELL, Efextra, HCL,


Categories