ASP.NET MVC Controls | ComponentOne
Client- Side API Reference / Input
In This Topic
    Input
    In This Topic

    All controls in ASP.NET MVC Edition are optimized for client-side web development.

    You can access Input controls on client-side with the help of wijmo.Control.getControl() method. Add the script that accesses the control after the control declaration. Use the control's Id to create its jQuery selector and use the client-side API.

    The following code sample demonstrates how to access a Calendar on client-side.

    Client-Side Access
    Copy Code
    @using MVCFlexGrid.Models
    @{
        //create variables to set min, max and current values
        var today = DateTime.Now.Date;
        var minDate = new DateTime(today.Year, 1, 1);
        var maxDate = new DateTime(today.Year, 12, 31);
    }
    <div>
        //initialize a calendar control
        @(Html.C1().Calendar()
                //customize the control
            .Id("calendr")
            .Value(today).Min(minDate).Max(maxDate).MonthView(true)
            .Width(300)
        )
    </div>
    <script>
        var cal;
        c1.mvc.Utils.documentReady(function ()
        {
            cal = wijmo.Control.getControl('#calendr');
        });
    </script>
    

    See Wijmo Input API Documentation for more information.