Skip to content Skip to sidebar Skip to footer

Html.radiobutton Of Asp.net Mvc Generates Id And Name Same

<%=Html.RadioButton('BookType', '1') %> C# <%=Html.RadioButton('BookType', '2') %> VB Above code generates Below code Copy

Solution 2:

<%= Html.RadioButton("BookType", "1", new { id = "rdoCSharp" }) %> C#
<%= Html.RadioButton("BookType", "2", new { id = "rdoVb" }) %> VB

Solution 3:

Use:

<%=Html.RadioButton("BookType", "1",new{@id="BookType1"})  %> C#
<%=Html.RadioButton("BookType", "2",new{@id="BookType2"})  %> VB

Post a Comment for "Html.radiobutton Of Asp.net Mvc Generates Id And Name Same"