<%=Html.RadioButton("BookType", "1") %> C#
<%=Html.RadioButton("BookType", "2") %> VB
Above code generates Below code
<input id="BookType" name="BookType" type="radio" value="1" >C#
<input id="BookType" name="BookType" type="radio" value="2" >VB
I need same name but different ids
I want output like
*
<input id="rdoCSharp" name="BookType" type="radio" value="1" >C#
<input id="rdoVb" name="BookType" type="radio" value="2" >VB
*
You can override the defaults by passing the attributes you wish to apply using an overload of the RadioButton method: