コード例 #1
0
        private void UpdateSelectedMembers()
        {
            //get keys of selected visible members
            System.Collections.Specialized.StringCollection chkList   = new System.Collections.Specialized.StringCollection();
            System.Collections.Specialized.StringCollection radioList = new System.Collections.Specialized.StringCollection();

            for (int j = 0; j < Request.Form.Count; j++)
            {
                string mKey = Request.Form.Keys[j];
                string mVal = Request.Form[j];


                if (mKey.StartsWith(_selControl.UniqueID + ":m:"))
                {
                    if (mVal == "on")                  //checkboxes
                    {
                        int index = mKey.IndexOf(":");
                        index = mKey.IndexOf(":", index + 1) + 1;
                        string uniqueName = mKey.Substring(index, mKey.Length - index);
                        chkList.Add(uniqueName);
                    }
                    else if (mVal.StartsWith("m"))                   //radios
                    {
                        int    index      = mVal.IndexOf(":") + 1;
                        string identifier = mVal.Substring(index, mVal.Length - index);
                        radioList.Add(identifier);
                    }
                }
            }


            try
            {
                _contr.AddMembersAndRemoveSiblings(chkList, true);
                _contr.AddMembersAndRemoveSiblings(radioList, false);
            }
            catch (Exception exc)
            {
                this.ShowException(exc);
                return;
            }
        }