New to Telerik UI for ASP.NET MVCStart a free 30-day trial

ASP.NET MVC Form Overview

The Telerik UI Form HtmlHelper for ASP.NET MVC is a server-side wrapper for the Kendo UI Form widget.

The Telerik UI Form for ASP.NET MVC allows you to generate and manage forms. Through a variety of configuration options, it makes creating and customizing forms a seamless experience. Achieve the desired form appearance by using default or custom editors, choose layout and orientation, display the editors in groups and columns, and configure validation.

Initializing the Form

The following example demonstrates how to define the Form.

Razor
    @(Html.Kendo().Form<MyApplication.Models.UserViewModel>()
        .Name("formExample")
        //configure the action and method attributes of the HTML <form> element
        .HtmlAttributes(new { action = @Url.Action("MyAction","MyController"), method = "POST" })
        .Items(items =>
        {
            items.Add()
                .Field(f => f.FirstName)
                .Label(l => l.Text("First Name:"));
            items.Add()
                .Field(f => f.LastName)
                .Label(l => l.Text("Last Name:"));
            items.Add()
                .Field(f => f.UserName)
                .Label(l => l.Text("Username:"));
            items.Add()
                .Field(f => f.Password)
                .Label(l => l.Text("Password:"))
                .Hint("Hint: enter alphanumeric characters only.");
        })
    )

Functionality and Features

FeatureDescription
ItemsThe configuration of the Form Items allows you to customize their appearance and behavior.
LayoutYou can choose between the default and Grid layout.
GroupsThe Form allows you to group the input fields in logical sections.
ButtonsAlter the Submit and Clear buttons appearance.
OrientationYou can choose between a vertical or horizontal orientation of the labels in the Form.
ValidationThe Form has a built-in validator to enable seamless client-side validaiton.
Hidden FieldsYou can hide specific fields, like the ID.
AccessibilityThe component is accessible for screen readers, supports WAI-ARIA attributes, and delivers keyboard shortcuts for faster navigation.

Next Steps

See Also