title: How to determine if a control is a Checkbox or a Radio Button?
body: <p>i have an if statement that neds to check if the control passed is a checkbox or a radio button</p>
  
  <pre><code>            If TypeOf (Control) Is CheckBox Then
  
                  If count = 1 Then
                      text += Me.GetCheckBoxValueJQuerySyntax(Control.ClientID) &amp; " + '~' + "
                  Else
                      text += Me.GetCheckBoxValueJQuerySyntax(Control.ClientID) &amp; "'~' + "
                  End If
  
              End If
              If TypeOf (Control) Is RadioButton Then
  
                  If CType(Control, RadioButton).GroupName &lt;&gt; "" Then
  
                      If Not Me._GroupNameArrayList.Contains(CType(Control, RadioButton).GroupName) Then
  
                          Me._GroupNameArrayList.Add(CType(Control, RadioButton).GroupName)
  
                          If count = 1 Then
                              text += Me.GetRadioValueJQuerySyntax(Control.ClientID) &amp; " + '~' + "
                          Else
                              text += Me.GetRadioValueJQuerySyntax(Control.ClientID) &amp; "'~' + "
                          End If
                      End If
                  Else
  
                      If count = 1 Then
                          text += Me.GetRadioValueJQuerySyntax(Control.ClientID) &amp; " + '~' + "
                      Else
                          text += Me.GetRadioValueJQuerySyntax(Control.ClientID) &amp; "'~' + "
                      End If
  
                  End If
  
  
              End If
  </code></pre>
  
  <p>This fails as the checkbox and redio button derive from the same class, so how would i check if the control is a checkbox or a radio button</p>