Click here to Skip to main content
15,900,258 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
hi!
my problem is that i have multiple buttons on aspx page in different tab panels.
and i am also using asp:validators on controls of this page which are in differnet tab panels.for e.g in one tab panel i have a button and different controls..and i want to validate the values of these controls..and on the other tab of this same page i have another button with different controls with validation...now i want that in 1st tab panel when btton is pressed only control of that panel should be validated and the button handler should fire the event but the problem is that until and unless the controls of 2nd tabpanel are not validated the event doesnot get triggered..i want to associate the button with only that panel not the other panel controls should be validated when the 1st panel button is clicked..
please solve this problem..
Posted

 
Share this answer
 
v2
Use Validation Group on all the controls you want to validate and the button that triggers validation

read this
http://msdn.microsoft.com/en-us/library/ms227424.aspx
 
Share this answer
 
please add the "validationgroup" property to button and corresponding control in that panel
For eg:

Your first tabpanel contains,
1 textbox and 1 button named
txtname and btnsave

txtname.validationgroup="Save" and
brnsave,validationgroup="Save"


Next tabpanel contains,
1 textbox and 1 button named
txtage and btnsubmit

txtage.validationgroup="Sub"
btnSubmit.validationgroup="Sub"


ie,Giving same validation group name to controls in the same group
 
Share this answer
 
Hi, If i understand your question right you can use ValidationGroup property of all associated controls (Including Validation Control itself). for example set ValidastionGroup of Button,RequiredFieldValidator and TextBoxes in one tab to gr1 and other tab to gr2. It should make controls in each group work independently.
 
Share this answer
 
thank you so much...it solved my problem..thanks alot
 
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