Click here to Skip to main content
11,924,800 members (56,697 online)
Rate this:
Please Sign up or sign in to vote.
Hello everyone. I just cant seem to figure out how to add an event click for a dynamic menu. I'm very noob in using C# so i'm really dumb about this. Here's my adding of menu code:

private void loadCat()
           int i = 0;
           foreach (DataRow dr in blcategory.LoadCategory().Rows)
               dt = new DataTable();
               cat = Convert.ToString(dr[1]);
               MenuItem mniTemp = new MenuItem();
               mniTemp.Text = cat;
               if (dt != null)
                   //DataTable dt2;
                   Boolean b;
                   b = blcategory.LoadByCatRetNull(cat);
                   if (b != true )
                       foreach (DataRow drc in blcategory.LoadByCat(cat).Rows)
                       mnuCategory.Items[i].ChildItems.Add(new MenuItem
                           Text = Convert.ToString(drc[1]),
                           NavigateUrl = "~/ItemsByCat.aspx"

               i += 1;
Please I'm very dumb about this and if you guys can teach me a step by step method to do this is greatly appreciated. Just imagine teaching a dumb person. Thank you so much guys!
Posted 18-Oct-12 22:57pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.151125.3 | Last Updated 19 Oct 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100