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>
mani-hellboy commented: where your code behind +0
Member Avatar for postonoh

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

using system.web.ui.webcontols;

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.