Venkat Mungari

Venkat Mungari

  • NA
  • 854
  • 25.1k

problem while dealing with Checkboxes

Oct 5 2012 4:17 AM
Hi Friends.

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....

help me please..
thanks in advance....




M.venkat
Hyderabad

Answers (2)