G
Guest
Hi,
I have the following nested RadioButtonList in my web page that displays a
list of cities (categorized in states) for the user to select. There's a
RequiredFieldValidator to ensure user has selected one state.
<asp:RequiredFieldValidator ID="VrqCity" runat="server" CssClass="error"
ErrorMessage="Please select a city" ControlToValidate="RblCities" /><br />
<asp:Repeater ID="RptStates" runat="server"
OnItemDataBound="GetBackPageTemplates">
<ItemTemplate>
<strong><%# DataBinder.Eval(Container.DataItem,
"stateName").ToString()%></strong>
<hr />
<asp:RadioButtonList ID="RblCities" runat="server"
RepeatDirection="Horizontal" RepeatColumns="5" CssClass="text"
CellPadding="5" />
</ItemTemplate>
</asp:Repeater>
However, when the page is loaded, it shows the error:
Unable to find control id 'RblCities' referenced by the 'ControlToValidate'
property of 'VrqCity'.
What's wrong?
ywb.
I have the following nested RadioButtonList in my web page that displays a
list of cities (categorized in states) for the user to select. There's a
RequiredFieldValidator to ensure user has selected one state.
<asp:RequiredFieldValidator ID="VrqCity" runat="server" CssClass="error"
ErrorMessage="Please select a city" ControlToValidate="RblCities" /><br />
<asp:Repeater ID="RptStates" runat="server"
OnItemDataBound="GetBackPageTemplates">
<ItemTemplate>
<strong><%# DataBinder.Eval(Container.DataItem,
"stateName").ToString()%></strong>
<hr />
<asp:RadioButtonList ID="RblCities" runat="server"
RepeatDirection="Horizontal" RepeatColumns="5" CssClass="text"
CellPadding="5" />
</ItemTemplate>
</asp:Repeater>
However, when the page is loaded, it shows the error:
Unable to find control id 'RblCities' referenced by the 'ControlToValidate'
property of 'VrqCity'.
What's wrong?
ywb.