Search results

Getting Started

This section briefly explains about how to create a simple SplitButton in your ASP.NET Core application. You can refer ASP.NET Core Getting Started documentation page for introduction part of the system requirements and configure the common specifications.

Add RadioButton to the project

To create simple RadioButton add the ejs-radiobutton tag with id attribute as element in your Index.cshtml page.

tagHelper
default.cs
<ejs-radiobutton id="radio1" label="Option 1" name="default"></ejs-radiobutton>
<ejs-radiobutton id="radio2" label="Option 2" name="default"></ejs-radiobutton>
public IActionResult Index()
    {
            return View();
    }

Output be like the below.

RadioButton Sample

Run the application

After successful compilation of your application, simply press F5 to run the application.

The following example shows a default rendering of RadioButton.

tagHelper
default.cs
<ejs-radiobutton id="radio1" label="Option 1" name="default"></ejs-radiobutton>
<ejs-radiobutton id="radio2" label="Option 2" name="default"></ejs-radiobutton>
public IActionResult Index()
    {
            return View();
    }

Change the RadioButton state

The Essential JS 2 RadioButton contains 2 states visually, they are as follows:

  • Checked
  • Unchecked

The RadioButton checked property is used to handle the checked and unchecked state. In the checked state an inner circle will be added to the visualization of RadioButton.

tagHelper
state.cs
<ejs-radiobutton id="radio1" label="Option 1" name="state" checked="true"></ejs-radiobutton>
<ejs-radiobutton id="radio2" label="Option 2" name="state"></ejs-radiobutton>
public IActionResult state()
    {
            return View();
    }