G
Guest
Hi,
I need to validate a hidden input in my webform to ensure that it's got
value. The controls look something like this:
<input id="HidSelectedStates" type="hidden" runat="server" /><br /><br />
<asp:Button ID="BtnSubmit" runat="server" OnClick="BtnSubmit_Click"
Text="Submit" ValidationGroup="submitStates" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1"
ControlToValidate="HidSelectedStates" runat="server" ErrorMessage="Please
select the states" ValidationGroup="submitStates" />
However, this gives the following error
System.Web.HttpException: Control 'HidSelectedStates' referenced by the
ControlToValidate property of 'RequiredFieldValidator1' cannot be validated
How can I get around this?
WB.
I need to validate a hidden input in my webform to ensure that it's got
value. The controls look something like this:
<input id="HidSelectedStates" type="hidden" runat="server" /><br /><br />
<asp:Button ID="BtnSubmit" runat="server" OnClick="BtnSubmit_Click"
Text="Submit" ValidationGroup="submitStates" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1"
ControlToValidate="HidSelectedStates" runat="server" ErrorMessage="Please
select the states" ValidationGroup="submitStates" />
However, this gives the following error
System.Web.HttpException: Control 'HidSelectedStates' referenced by the
ControlToValidate property of 'RequiredFieldValidator1' cannot be validated
How can I get around this?
WB.