I have a ListView
<asp:ListView ....>
<asp:TextBox ID="txtComment" ... />
<asp:RequiredFieldValidator ID="rfvComment" ControlToValidate="txtComment" ... />
<act:ValidatorCalloutExtender ID="vceComment" TargetControlID="rfvComment" ... />
<asp:Button ID="btnAddComment" ... />
</asp:ListView>
lets say this ListView creates the following:
TextBox1
Button1
TextBox2
Button2
TextBox3
Button3
If I click on Button2 the RequiredFiledValidator/ValidatorCalloutExtender are applied to TextBox1 instead of TextBox2, if I click on Button3 the RequiredFiledValidator/ValidatorCalloutExtender are applied to TextBox1 as well, I want the RequiredFiledValidator/ValidatorCalloutExtender to apply to the TextBox next to the button, so if I click Button3 I want it to apply to TextBox3.
Does anyone know how can I achieve this?
thank you.
Use ValidationGroup property and generate it value dynamically:
Add script below at very bottom of form:
I suppose it would be better to customize toolkit source, but I’m not in the mood to do this 🙂 So hope this script will fix your problem