Click here to Skip to main content
15,912,493 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have two button.
1)search button
2)back button to redirect to another page

I have a required field validator on one text box. Then a validation control.

when i click on search button without entering anything. the showmessagebox which is true..displays the message "you must enter value"

But when i am clicking the back button ..its showing me the same message which i dont want...kindly guide me
Posted
Comments
Richard C Bishop 17-Jun-13 15:25pm    
Post your code, but you probably just need to set the CausesValidation property to false on your back button.
anurag19289 17-Jun-13 15:28pm    
ohhhhhhhhhhhhhhhhh correcttttttttt....right now code is not with me...i will check this
ZurdoDev 17-Jun-13 17:05pm    
You need to reply to the user so that they are notified instead of adding a comment to your own question.

Dear Anurag,

It's very simple, you can do this in two ways.

1. Set the ValidationGroup property of the Validation control and Search button with the same value suppose "S"

Other way just change the validationGroup property of your Back button with some different value.

Please make it resolved if my answer helps you.

Thanks and regards
Suman Zalodiya
 
Share this answer
 
You can use the Property CausesValidation="false" for the Button
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900