• RadioButton单选


    前台用了repeater控件,repeater里装着<asp:RadioButton ID="rdbUserName" runat="server" AutoPostBack="true" ValidationGroup='<%#Eval("U_UserID") %>' OnCheckedChanged="RadioButton_CheckedChanged"/>

    后台:

     public void RadioButton_CheckedChanged(object sender, EventArgs e)        

    {             RadioButton rdb = sender as RadioButton;            

          RepeaterItem item = rdb.Parent as RepeaterItem;            

          int count = rptItems.Items.Count;            

         for (int i = 0; i < count; i++)            

        {                

          RadioButton rdbUserName = rptItems.Items[i].FindControl("rdbUserName") as RadioButton;                

          userId = rdb.ValidationGroup.ToString();                

          if (i != item.ItemIndex)                

          {                    

          rdbUserName.Checked = false;          

          }

                }

        }

  • 相关阅读:
    Python模块:struct
    Python模块:hashlib
    Python模块:collections
    python:爬虫
    Python:进程
    Python:线程
    Python:socket
    Welcome to ARFA's cnblog ! (Click me)
    骗访问量的机房人物列传by xMinh
    关于我
  • 原文地址:https://www.cnblogs.com/zhongchaotong/p/3981722.html
Copyright © 2020-2023  润新知