-1

When I type in "RangeValidator1.MaximumValue = "999" in the code-behind, in let's say the Page_load event, it does not recognize the "RangeValidator1" in the intellisense. Here is how the GridView and RangeValidator are defined:

<asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
    AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="ID_KEY" 
    DataSourceID="SqlDataSource5" 
    EmptyDataText="There are no data records to display." 
    onrowediting="GridView1_RowEditing" onload="GridView1_Load" 
    ondatabinding="GridView1_DataBinding" ondatabound="GridView1_DataBound" 
    onrowdatabound="GridView1_RowDataBound">
    <Columns>
      <asp:CommandField ShowEditButton="True" />
      <asp:TemplateField HeaderText="QTY_ORD" SortExpression="QTY_ORD">
   
        <EditItemTemplate>
          <asp:TextBox ID="TextBox1" runat="server" 
            Text='<%# Bind("QTY_ORD", "{0:#,###}") %>'></asp:TextBox>

          <asp:RangeValidator ID="RangeValidator1" Runat="server" 
          ErrorMessage="Order Quantity outside of MIN/MAX range."
          MaximumValue="100" MinimumValue="10" 
          Type = "Integer"  
          ControlToValidate="TextBox1">*</asp:RangeValidator> 
        </EditItemTemplate>

        <ItemTemplate>
          <asp:Label ID="Label1" runat="server" 
            Text='<%# Bind("QTY_ORD", "{0:#,###}") %>'></asp:Label>
        </ItemTemplate>


        <ControlStyle Width="60px" />
        <ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
    </Columns>
Votes + Comments
where your code behind
2
Contributors
1
Reply
3
Views
6 Years
Discussion Span
Last Post by postonoh
0

try to reference he system.web.ui.webcontrols Namespace.

using system.web.ui.webcontols;

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.