Search results

Name and Value in form submit in ASP.NET MVC RadioButton control

18 Jan 2022 / 1 minute to read

The name attribute of the RadioButton is used to group RadioButton. When the RadioButton are grouped in form, the checked items value attribute will be post to server on form submit that can be retrieved through the name. The disabled RadioButton value will not be sent to the server on form submit.

In the following code snippet, Credit and Debit card is in checked state. Now, the value that is in checked state will be sent on form submit.

Copied to clipboard
@Html.EJS().RadioButton("radio1").Label("Credit/Debit Card").Name("payment").Checked(true).Render()
@Html.EJS().RadioButton("radio2").Label("Net Banking").Name("payment").Render()
@Html.EJS().RadioButton("radio3").Label("Cash on Delivery").Name("payment").Render()


.e-radio-wrapper {
  margin-top: 18px;

button {
  margin: 20px 0 0 5px;

li {
  list-style: none;

Copied to clipboard
public ActionResult Form()
    return View();