Venkat Mungari

Venkat Mungari

  • NA
  • 854
  • 26.1k

Some problem Through dealing with Checkboxwes

Oct 6 2012 3:00 AM
Hi 
 
I have some checkboxes(example 1000 checkboxes)  in one page (example MyUser.aspx) and i can create some groups using these checkboxes in MyUserGroups.aspx,.if i can create one group(suppose  groupname as GROUP1) in createUserGroup.aspx using first 5 checkboxes,and click SAVE button it will goes to DB and it will show in MyUserGroups.aspx if i can add same  5 checkboxes to same group(GROUP1) then duplicate checkboxes shoud be disable....



below code gives unique values .......
 class Class1
    {
        static void Main()
        {
            string str = "Zaphod,Zaphod,Zaphod,Ford,Zaphod,Trillian" ;
            string[] strings = str.Split(',');
            var count=new Dictionary<string,int>();
            //var count = new Dictionary<string, int>();
            foreach (string s in strings)
            {
                if (count.ContainsKey(s))
                {
                    count[s]++;
                }
                else
                {
                    count.Add(s,1);
                }
            }
            foreach (var item in count)
            {
                Console.WriteLine("{0}", item.Key);
            }
            Console.ReadLine();
        }
    }
}

i can solve this problem to some level....
only unique user can show in DB but in creategroup.aspx page all user(means 10 checkboxes) will displayed till we go for another event....