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

What kind of programming language is ASP.NET?

0 Answers   3i Infotech,


What is stateless asp or asp.net ?

2 Answers   Accenture, BirlaSoft,


What is diff. Between abstract class and an interface?

0 Answers  


What is active web pages?

0 Answers  


how we can solve machine key error in asp.net?

3 Answers  


What are the Types of chaching. How to implement caching

0 Answers   Microsoft,


i need code for insert,delete,update adn display records using stored procedure in C#

2 Answers  


hi guys do u know how to go one page to one page to another page plz tell me any of u know

3 Answers  


How can we identify that the page is post back in asp net?

0 Answers  


What is the difference between Codebehind="MyCode.aspx.cs" andSrc="MyCode.aspx.cs"?

1 Answers   Innvectra,


How to set the pane area to transparent of a scrollPane component.?

0 Answers   MCN Solutions,


what is the differance between .DLL & .EXE

10 Answers   Infinite Computer Solutions,


Categories