• Material 3
  • Material 3 Dark
  • Fluent
  • Fluent Dark
  • Bootstrap v5
  • Bootstrap v5 Dark
  • Tailwind CSS
  • Tailwind CSS Dark
  • Material
  • Bootstrap v4
  • High Contrast
Preferences
Theme Selection
Mode Selection
Touch
Mouse
Localization
*Translated by Google Translator.
Currency

Example of Switch in ASP.NET MVC Button Control

Click the submit button to post the current state of the Switch. When submitting the Switch in `off` state, validation error message will be shown by using Data Annotation.

DEMO
SOURCE

This sample demonstrates strongly typed support in Switch. You can bind model property to the Switch by using Lambda Expression. While submitting form, the model property will be based on checked state of the Switch.

More information on Switch can be found in this documentation section .