title: Requied in Group Button in ASP.Net-MVC C# (not using angularjs and not access to form validation function)
body: <p>I'm trying to write a component to create a group button using bootstrap in ASP.Net-MVC C#. </p>
  
  <p>I've successfully write it, but I have a little problem. In form validation, I need to check if at least one a element in my button group was selected. How can I add data-val or required to my button group? </p>
  
  <p>Here is an example of this component: </p>
  
  <pre><code>&lt;div class="btn-group" role="group" id="User_Sex"&gt;
  
          &lt;label class="btn btn-primary"&gt;
              &lt;input name="User.Sex" value="Male" class="d-none" type="radio"&gt;
              &lt;span&gt;Male&lt;/span&gt;
          &lt;/label&gt;
  
          &lt;label class="btn btn-primary"&gt;
              &lt;input name="User.Sex" value="Female" class="d-none" type="radio"&gt;
              &lt;span&gt;Female&lt;/span&gt;
          &lt;/label&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>Do I need an input or select to do it? </p>