在GridView上的Repeat控件上找控件

  foreach(GridViewRow gr in gv.Rows)
{
foreach (RepeaterItem item in gr.FindControl("rp").Controls)
{

foreach (Control ct in item.Controls)
{
if (ct.GetType().ToString() == "System.Web.UI.HtmlControls.HtmlInputRadioButton")
{
HtmlInputRadioButton rd = ct as HtmlInputRadioButton;
if (rd.Checked)
{
if (!htQP.ContainsKey(rd.Name))
htQP.Add(rd.Name, rd.Value);
}
}

}
}
}
原文地址:https://www.cnblogs.com/pigddyou/p/2302363.html