I have a repeater that displays key-value pairs from a database table. Some of the fields in the table have min/max restriction. How can I add a range validator to the repeater and be able to use different ranges for different fields?
For example, some table fields are:
Idle Time: 20 (min 10, max 40)
Pickup Time: 60 (min 3, max 90)
When page is displayed it shows "Idle Time" (a label) and 20 in a text box, the nest row is "Pickup Time" (a label) and 60 in the textbox. I need to prevent the user from entering 80 or 5 in Idle Time, but 80 or 5 is valid for Pcikup Time.
<ItemTemplate> <tr> <td style="vertical-align:top" class="BoldSmall"> <asp:Label runat="server" ID="lblName" Text='<%# Eval("GLOBALCONFIGNAME")%>' /> </td> <td style="vertical-align:top" class="BoldSmall"> <asp:TextBox runat="server" ID="tbValue" CssClass="NormalSmall" Text='<%# Eval("GLOBALCONFIGVALUE")%>' Width="140" /> </td> </tr> </ItemTemplate> For textbox "tbValue" I need to add range validator, but the range change depending on what row of the table I am displaying in the repeater.
(e.g. first item of repeater has "Idle Time" as globalconfigname and 20 as globalconfigvalue; next item has "Pickup Time" as globalconfigname and 60 as globalconfigvalue, ...)
Thanks.