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.
To create simple RadioButton add the ejs-radiobutton
tag with id attribute as element
in your Index.cshtml page.
<ejs-radiobutton id="radio1" label="Option 1" name="default"></ejs-radiobutton>
<ejs-radiobutton id="radio2" label="Option 2" name="default" checked="true"></ejs-radiobutton>
public ActionResult Index()
{
return View();
}
Output be like the below.
After successful compilation of your application, simply press F5
to run the application.
The following example shows a default rendering of RadioButton.
<ejs-radiobutton id="radio1" label="Option 1" name="default"></ejs-radiobutton>
<ejs-radiobutton id="radio2" label="Option 2" name="default" checked="true"></ejs-radiobutton>
public ActionResult Index()
{
return View();
}
The Essential JS 2 RadioButton contains 2 states visually, they are as follows:
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.
<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 ActionResult state()
{
return View();
}