Telerik UI for ASP.NET MVC Switch Basic Usage

Loading Demo...
  • EXAMPLE
  • VIEW SOURCE
index.cshtml
IndexController.cs

Also available for:

CLIENT-SIDE API SERVER-SIDE API
devcraft ninja image

The Switch component is part of Telerik UI for ASP.NET MVC, a professional grade UI library with 110+ components for building modern and feature-rich applications. To try it out sign up for a free 30-day trial.

Description

The Telerik UI for ASP.NET MVC Switch is a component that displays two exclusive choices–checked and unchecked. Also known as a Toggle button, the Switch control supports configuration options for easy customization.

The current example displays a common use-case scenario for a Switch component.

The ASP.NET Core Switch control is part of Telerik UI for ASP.NET MVC, a professional-grade UI library with 110+ components for building modern and feature-rich web applications. The Switch is a server-side wrapper for the Kendo UI for jQuery Switch component comes in the form of an HtmlHelper.

Functionality and Features

  • Label messages—Define the texts of the checked and unchecked Switch labels.
  • Enabled, disabled, and readonly state—Choose to enable, disable, or make the Switch read-only. For example, if you may want to disable the input for non-authorized users.
  • Bind-value and value—Set and get the Switch value, and use the SwitchFor() configuration to bind the component to a Model property.
  • Appearance—Set the size and radius of the track and thumb border.
  • API—Use the API functions to dynamically change the state of the Switch.
  • Accessibility, keyboard navigation, and RTL support—The Switch is accessible for screen readers, supports WAI-ARIA attributes, and delivers keyboard shortcuts for faster navigation. The Switch component also enables you to render it in a right-to-left direction.

Additional Apps

This Switch example is part of a unique collection of hundreds of ASP.NET MVC demos, with which you can see all Telerik ASP.NET MVC components and their features in action. View the source code of the demos from the library or directly adapt, and edit them and their theme appearance in the ThemeBuilder.

Support & Learning Resources

Additional Resources