How to validate only few controls ? Anyway to group it on click of a button?
I have开发者_开发知识库 a table design, used by recruiter to upload profiles. Each row contains a txtname,txtContactNo,txtEmailID and a submit link button at the end of each row(contained in last column of the table). There are 5 such rows. I want all the txt boxes in row 1 to be filled before clicking on btnSubmit1 (and same with all other row on click of their corresponding submit button). I have placed requiredFieldValidator to all the controls of all the rows. If i click on submit button of first row, it giving error on all the controls of all the rows. I want that my first submit button should check only those controls that are in first row, instead of all the controls.
Please Help !
The Textcontrols and the Button causing the Submit have a Property called ValidationGroup
.
So set the same ValidationGroup for the Textboxes in the first row and button 1
Set the ValidationGroup
property on the validators and submit button, by row.
E.g. all the validators and btnSubmit in row 1, ValidationGroup="valgroup1"
,
all the validators and btnSubmit in row 2, ValidationGroup="valgroup2"
, etc.
精彩评论