asp menu

hey guys i need to develop a menu using asp control to look like this:

 menu
i can use css friendly, the hard part is the alternating colours.

please help?
JCWEBHOSTAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

royendCommented:
When you are looping through your menu-items, set the color by using the modulo operator:

int count = 0;
foreach(MenuItem m in Menu)
{
   if(count % 2 == 0)
    {
        //set color = blue
    }
    else
    {
        //set color = yellow
    }

   count++;
}

Open in new window

0
JCWEBHOSTAuthor Commented:
must i code in c#? couse i can.

just that i do not know were to start?
0
royendCommented:
Some info on the modulo operator:
It is a mathematical operator that gives you the remainder of a division.

E.g. if you divide 3 by 2, you get 1.5, or a remainder of 1 which is what the modulo operator would return.
Furthermore, if you divide 5 by 2, you get 2.5, and still the modulo function would return 1.
However, dividing 4 by 2, you get 2.0, and thus a remainder = 0, and modulo = 0.

In C#:
0 % 2 = 0
1 % 2 = 1
2 % 2 = 0
3 % 2 = 1
4 % 2 = 0
and so on...

you can of course divide by other numbers:
0 % 3 = 0
1 % 3 = 1
2 % 3 = 2
3 % 3 = 0
4 % 3 = 1
and so on....

If you are using VB you may use Mod instead of %:
0 Mod 3 = 0
0
Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

royendCommented:
How do you code your menu today? Are you using ASP.NET grid or repeater, or just HTML?
0
JCWEBHOSTAuthor Commented:
how to set the menu background colour?

            Menu Menu = (Menu)(FindControl("Menu"));
            Menu.Items.Add(new MenuItem("Home", "", "", "#"));
            Menu.Items.Add(new MenuItem("Kids Playground Equipment", "", "", "#"));
            Menu.Items.Add(new MenuItem("Kids Entertainment", "", "", "#"));
            Menu.Items.Add(new MenuItem("Contact Us", "", "", "#"));
0
royendCommented:
I think it may help you to read this page:
http://weblogs.asp.net/dannychen/archive/2005/12/02/432190.aspx
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.