Adding a custom class to Radio Buttons in ASP.NET MVC 4

user2377475

I'm trying to add Bootstrap classes to a set of radio buttons.

@Html.RadioButtonFor(model => model.Male, !Model.Male) Female
@Html.RadioButtonFor(model => model.Male, Model.Male) Male

Just don't seem to get the right way of doing it. Any help appreciated. Thanks

Zabavsky
@Html.RadioButtonFor(model => model.Male, !Model.Male, new { @class = "female"})
@Html.LabelFor(model => model.Male, "Female", new { @class = "female"})

@Html.RadioButtonFor(model => model.Male, Model.Male, new { @class = "male"})
@Html.LabelFor(model => model.Male, "Male", new { @class = "male"})

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Custom styled radio buttons using ASP.NET MVC Helpers

Binding 4 Radio buttons using @html.RadioButtonFor MVC4 ASP.Net

Adding custom radio buttons in android

ASP.NET MVC 5 group of radio buttons

Binding radio buttons in ASP.NET MVC page with razor

Input radio buttons in ASP.NET Core MVC with taghelpers

Adding a custom class to DropDownList in MVC 4

Adding custom buttons to Kendo grid toolbar in ASP.NET Core

Custom redirection in ASP.NET MVC 4

ASP.NET MVC 4 Custom URL

ASP.NET MVC 4 Custom Authorize filter on Controller class and Method

Adding Custom Refrence for ASP.Net MVC on Visual Studio Code

Adding custom roles to windows roles in ASP.NET MVC 5

ASP.NET MVC 3 Razor - Adding class to EditorFor

Adding .png image to the title property - ASP.Net MVC 4

Adding custom link buttons to ASP GridView

mvc: Adding values of radio buttons checked into a collection and saving to database

adding labels to radio buttons

Authenticate custom user class in Asp.Net MVC

Adding a class to collection_radio_buttons [Ruby on Rails]

ASP.NET MVC 4 Custom 404 Page

Custom URL Routing in Asp.Net MVC 4

ASP.NET MVC 4 Custom Handle Error

Custom validation summary in ASP.NET MVC 4

ASP.Net MVC 4 Custom ValidationAttribute Dependency Injection

Client side validation for custom validator asp.net MVC 4

ASP.NET MVC 4 - Custom Membership & Role Entities Not Updating

How to add required field validation on client side with custom message for Radio Button in ASP.Net MVC?

What is the alternative to Static Class in asp.net mvc 4?