Siddhesh Posted March 1, 2006 Share Posted March 1, 2006 Hi,I Have 2 Text Box And 2 Buttons(Save, Search).Now if I click on Save Button Then Requirefieldvalidator for both the Text Boxes shoould work, but when I click on Search button validator for the text fields should not work.Is it Possible??It can be done using javascript, but can we do it only with .NETI m using ASP.NET with language VB Link to comment Share on other sites More sharing options...
pr.nimbalkar Posted March 2, 2006 Share Posted March 2, 2006 Hi,I Have 2 Text Box And 2 Buttons(Save, Search).Now if I click on Save Button Then Requirefieldvalidator for both the Text Boxes shoould work, but when I click on Search button validator for the text fields should not work.Is it Possible??It can be done using javascript, but can we do it only with .NETI m using ASP.NET with language VB<{POST_SNAPBACK}> Hello Siddhesh, Plz see the 'cause validation' property of the 'Search' button. I think , it may false.If yes, make it true ; ur validation will fire.Cheers..Prashant.. Link to comment Share on other sites More sharing options...
Siddhesh Posted March 3, 2006 Author Share Posted March 3, 2006 Hello Siddhesh, Plz see the 'cause validation' property of the 'Search' button. I think , it may false.If yes, make it true ; ur validation will fire.Cheers..Prashant..<{POST_SNAPBACK}> Ok, thats Fine.Now let me ask it in wide manner.I have 4 Textboxes and 2 Buttons(Save,Search).All the textboxes are having requiredfield validator.My requirement is that Only Two validators should work onclick of Save button.And other validator should work onclick of Search button.Thanks for help. Link to comment Share on other sites More sharing options...
Viggy Posted March 4, 2006 Share Posted March 4, 2006 Ok, thats Fine.Now let me ask it in wide manner.I have 4 Textboxes and 2 Buttons(Save,Search).All the textboxes are having requiredfield validator.My requirement is that Only Two validators should work onclick of Save button.And other validator should work onclick of Search button.Thanks for help.<{POST_SNAPBACK}> well u can also write a custom code that can be fired as u want. this will also help ur code to look more clean and easy to understand. also take a look at custom validator for asp.net Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now