I have an ascx control that inherits from ValidatableUserControl.
I have several requiredfieldvalidators on the page, and all of them are getting fired except the one inside an asp:panel
This code is inside a <table>
<asp:Panel runat = "server" ID = "PurchaseOrderPanel">
<tr>
<td><div class="txtClass">
<span class="required">*</span>
Number:
</div>
</td>
<td>
<asp:textbox CssClass = "txtClass" size="47" runat="server" id="Number" ></asp:textbox>
<asp:requiredfieldvalidator id="NumberRequired" runat="server" controltovalidate="Number" errormessage="Number is a required field" >*</asp:requiredfieldvalidator>
</td>
</tr>
</asp:Panel>
If I move the requiredfieldvalidator outside of the asp:panel, it would work, but that breaks the formatting.
The codebehind also uses
public override string ValidationGroup {
set {
base.ValidationGroup = value;
FirstNameRequired.ValidationGroup = LastNameRequired.ValidationGroup
= telPhone.ValidationGroup = value;
}
}
However, the controls other than firstname, lastname and telphone are properly being fired too, and none of those have any validation group attached to them.
(Note: the code is not entirely written by me, I am just trying to add the asp:panel control to someone else's code)