ComponentOne Input for ASP.NET WebForms
Task-Based Help / C1InputNumeric Tasks / Setting the Min/Max Value
In This Topic
    Setting the Min/Max Value
    In This Topic

    The following example demonstrates the C1InputNumeric control's numeric range support with the ability to easily change MinValue and MaxValue properties.

    To set the numeric values using the Tasks menu:

    1. Open the C1InputNumeric Tasks menu.
    2. Enter 1 for the MinValue.
    3. Enter 1000 for the MaxValue.
    4. With the Tasks menu still open, enter 1 in the Value text box.

    To set the numeric values using .html markup:

    To set the MinValue to 1, the MaxValue to 1000, and the Value to 1, use the following markup in the .aspx page:

    To write code in Source View

    <cc1:C1InputNumeric ID="C1InputNumeric1" runat="server"
    MaxValue="1000"
    MinValue="1"
    Value="1">
    </cc1:C1InputNumeric>

    To set the numeric value using code:

    To set the numeric value for the C1InputNumeric control, double-click the Web page to create an event handler for the Load event. Enter the following code for the Page_Load event:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    With C1InputNumeric1
        .MaxValue = 1000
        .MinValue = 1
        .Value = 1
    End With
    

    To write code in C#

    C#
    Copy Code
    this.C1InputNumeric1.MaxValue = 1000;
    this.C1InputNumeric1.MinValue = 1;
    this.C1InputNumeric1.Value = 1;
    

    Run the project and observe the following: