---
title: "RadioButton control in MVC"  
description: "RadioButton control in MVCHere I am explaining how to create RadioButton Control in MVC and get the selected radio button reference.  Here is an Ind"  
author: "Chris Anderson"  
published: 2011-10-03  
updated: 2020-03-18  
canonical: https://www.mindstick.com/articles/758/radiobutton-control-in-mvc  
category: "asp.net mvc"  
tags: ["asp.net mvc"]  
reading_time: 3 minutes  

---

# RadioButton control in MVC

## RadioButton control in MVC

Here I am explaining how to create [RadioButton](https://www.mindstick.com/blog/233/get-checked-radiobutton-using-javascript) Control in MVC and get the selected [radio button](https://www.mindstick.com/articles/12743/radio-button-in-android) [reference](https://www.mindstick.com/forum/34619/call-by-value-and-call-by-reference).\

Here is an Index View I have created various radio buttons that [displays web technologies](https://www.mindstick.com/Articles/1416/expandable-and-collapsible-rows-in-datagrid-in-c-sharp-winforms) name by using [Html Helper](https://www.mindstick.com/forum/155772/how-we-create-custom-html-helper-in-asp-dot-net-mvc). In the first parameter of the radio button, I passed the name of radio button and in the second parameter, I have passed its value that is similar to its text. **I have also created a [submit button](https://www.mindstick.com/forum/130/its-possible-without-submit-button) and on click of that submit button we get the value of selected radio button.** \

```
 <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<RadioButtonListMVC.Models.GenModel>" %>
<!DOCTYPE html>
<html>
<head runat="server">
     <title>Index</title>
</head>
<body>
 <% using (Html.BeginForm("Show","Home",FormMethod.Post)) { %>
     <div><b>Select Technology: </b>
         <%= Html.RadioButton("technology", "ASP.NET") %> ASP.NET
         <%= Html.RadioButton("technology", "PHP") %> PHP
         <%= Html.RadioButton("technology", "JSP") %> JSP
         <%= Html.RadioButton("technology", "ASP.NET MVC") %> ASP.NET MVC
         <br /><br />
         <input type="submit" value="Submit" />
     </div>
     <%} %>
</body>
</html>
```

After creating a radio button in View, you can retrieve the reference of the selected radio button with the help of the [Controller](https://www.mindstick.com/blog/273/passing-values-from-controller-to-view-in-asp-dot-net-mvc).

Here is a Controller, I have created a Show action that invokes when a submit button is pressed and when Show action invoked

it retrieves the reference of the selected radio button and the store its value in a string and then returns a formatted string.

```
using System.Web.Mvc;
using RadioButtonListMVC.Models;
namespace RadioButtonListMVC.Controllers{     public class HomeController :  Controller    {         public ActionResult Index()         {            return View();         }
         [AcceptVerbs(HttpVerbs.Post)]         public string Show(FormCollection form)         {            string selectedTechnology = form["technology"];            return "You have selected a technology: <b>"+selectedTechnology+"</b>";         }    }}
```

After performing the above task you can see an output in the browser that displays a list of the radio buttons. You can select [one of them](https://answers.mindstick.com/qa/47593/what-are-the-prevalent-water-proofing-systems-write-a-short-notes-on-any-one-of-them).

![RadioButton control in MVC](https://www.mindstick.com/mindstickarticle/43165056-d8d9-4cc9-bf5c-2c751d4704df/images/7b769d9b-a861-4e66-87c5-c6e528f3f183.png)

After selecting the choice when you press the submit button, the browser will show you the [value of the selected](https://www.mindstick.com/forum/159392/how-to-fetch-the-value-of-the-selected-options-in-drop-down-in-php) radio button.

![RadioButton control in MVC](https://www.mindstick.com/mindstickarticle/43165056-d8d9-4cc9-bf5c-2c751d4704df/images/dd69e0d2-585a-4851-a8e0-57d007f46317.png)\

By completing the above process you can simply learn how to create a radio button group or list and how to get [selected value](https://www.mindstick.com/forum/525/get-selected-value-of-datagridviewcomboboxcolumn) from the list of radio buttons in MVC.

---

Original Source: https://www.mindstick.com/articles/758/radiobutton-control-in-mvc

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
