---
title: "RadioButtonList in MVC"  
description: "RadioButtonList in MVC"  
author: "Anonymous User"  
published: 2014-10-08  
updated: 2014-10-08  
canonical: https://www.mindstick.com/forum/2331/radiobuttonlist-in-mvc  
category: "asp.net mvc"  
tags: ["asp.net", "asp.net mvc"]  
reading_time: 1 minute  

---

# RadioButtonList in MVC

I tried doing this but this only display the [radiobutton](https://www.mindstick.com/blog/233/get-checked-radiobutton-using-javascript) without [text](https://www.mindstick.com/blog/301635/did-people-reinvent-texting-to-express-the-full-range-of-emotions) beside it.

```
<% foreach (string s in Html.RadioButtonList("rbl")) {%>    <% =s %><% } %> 
```

## Replies

### Reply by Anonymous User

<%var radioButtonList = new SelectList(new List<ListItem> { new ListItem { Text = "Current", Value="false", Selected=true }, new ListItem { Text = "Other", Value="true"}}, "Value", "Text", "false");var htmlAttributes = new Dictionary<string, object> { { "class", "radioButtonList" }, { "onclick", "if(eval(this.value)) { $('#tblDate').show('slow'); } else { $('#tblDate').hide('slow'); }" }};foreach (var radiobutton in radioButtonList) { %> <%=Html.RadioButton("rblDate", radiobutton.Value, radiobutton.Selected, htmlAttributes)%> <label><%=radiobutton.Text%></label><% } %>


---

Original Source: https://www.mindstick.com/forum/2331/radiobuttonlist-in-mvc

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
