Search results

Set disabled state in ASP.NET MVC Toggle Switch Button control

14 Apr 2021 / 1 minute to read

Switch can be disabled by setting the disabled property to true.

The following example illustrates how to disable support in Switch component.

razor
default.cs
Copied to clipboard
@Html.EJS().Switch("default").Disabled(true).Render()
Copied to clipboard
public ActionResult Default()
{
    return View();
}