title: How To Find Checked Radio Button Using Group name My code Attached?
body: <p>i am trying to find the value of checked radio using group name i have method that return it but what should i pass in that method along with group name </p>
  
  <p>method is here,</p>
  
  <pre><code>private string getRadioValue(ControlCollection clts, string groupName)
  {
      string ret = "";
      foreach (Control ctl in clts)
      {
          if (ctl.Controls.Count != 0)
          {
              if (ret == "")
                  ret = getRadioValue(ctl.Controls, groupName);
          }
  
          if (ctl.ToString() == "System.Web.UI.WebControls.RadioButton")
          {
              RadioButton rb = (RadioButton)ctl;
              if (rb.GroupName == groupName &amp;&amp; rb.Checked == true)
                  ret = rb.Attributes["Value"];
          }
      }
      return ret;
  }
  </code></pre>
  
  <p>i use it like </p>
  
  <pre><code>Oc.aProjectSubmited = getRadioValue(RadioButton,"Aps");
  </code></pre>
  
  <p>where Aps is radio group but getting error "invalid argument" on radio button i pass ??</p>
  
  <p>hopes for your suggestion thanks in advance </p>