Thursday, November 7, 2013

Radio button with bootstrap in Asp.net

 It's now easier than ever before to build scalable responsive website layouts, using Bootstrap  web developer doesn't have to spend time laboriously working out.

ASP.NET developer can easily use bootstraps css classes for alignment form elements like radio buttons, checkbox, text field etc 

For group radio button alignment with bootstrap we can do following thing 

Put Asp.net radio buttons control in DIV which have 'control radio' class. "control radio" it is bootraps css classes. We just need to add this css classes in DIV


 <div class="controls radio">

     <asp:RadioButtonList ID="rblTiming" runat="server"  RepeatDirection="Horizontal" Width="200px">
          <asp:ListItem Selected="True" >Morning</asp:ListItem>
          <asp:ListItem>Afternoon</asp:ListItem>
     </asp:RadioButtonList>
  </div>

Result :





4 comments: