Click here to Skip to main content
13,836,677 members
Click here to Skip to main content
Add your own
alternative version

Tagged as


16 bookmarked
Posted 30 Mar 2010
Licenced CPOL

Custom Web Menu with Embedded Resources

, 30 Mar 2010
Rate this:
Please Sign up or sign in to vote.
This is a free custom web menu with Tigra menu (free JavaScript menu) embedded.


This is a free custom web menu with Tigra menu (free JavaScript menu) embedded. Menu creation and binding is dynamic. Data Source for the menu can be either an XML file or dataset filled from the DB. Menu styles can be easily overridden in the application that uses this menu using CSS. The menu supports various properties for customization. This custom article also explains how to embed resources in a custom control. The Custom web menu is a typical web menu that can be used in any web application.

Using the Code

Steps Involved in Setting the Project

  1. Download the projects.
  2. Set Default.aspx as “Set as start page”.
  3. Run the project.


The control generates menu to n-depth dynamically at runtime. The data source to the menu can be either a .xml file or a dataset. The source can be set using the properties MenuXMLPath or DataSource for XML or dataset respectively.

public string MenuXMLPath
    get{return xmlDataSource;} 
    set{xmlDataSource = value;} 

/// <summary>
/// DataSet from the XML menu as DataSource. 
/// </summary>

public DataSet DataSource 
 get{return dsMenu;}
 set{dsMenu = value;} 

This menu use the Tigra Menu JavaScript for dynamic menu creation and binding. The menu can extend to any depth. The datasource (XML file or DB table) to the control should be of the below schema:

  • Column 1: menuid (unique ID of menu item)
  • Column 2: name (name of the menu item)
  • Column 3: root (parent of the menu item. If it is the starting/root item, then the root value will be "", else it will be the value of the parent menuid).
  • Column 4: url (URL for the menu item)

To get the DLL, please run the project “CustomWebMenu".

Embedded Resource

Set the Build Action for the resource file as "Embedded Resource" from File->Properties->Build action.

Include the below code snippet in the AssemblyInfo.cs file:

[assembly: WebResource("CustomWebMenu.Resources.CustomWebMenu.js", 

[assembly: WebResource("CustomWebMenu.Resources.Images.OneStep.gif", "image/gif")]

Points of Interest

There may be many menus available on the web. This differs from all of them in the way the resources to the Menu like JavaScript files, images, etc. are embedded with the CustomWebMenu.dll. You need not carry those resources to the projects where you are going to use the menu. You just need to refer the CustomWebMenu.dll.


Use the source code. Blend it with various new ideas. Feedbacks, suggestion and corrections are welcome. Enjoy coding.

The above code embeds the resource to the assembly. This prevents carrying these files to the project where the DLL is referenced.


  • 30th March, 2010: Initial post


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


About the Author

rajesh peter
Software Developer
India India
A C# lover....

You may also be interested in...

Comments and Discussions

GeneralWeb Menu Pin
stixoffire5-Apr-10 19:45
memberstixoffire5-Apr-10 19:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web05 | 2.8.190114.1 | Last Updated 30 Mar 2010
Article Copyright 2010 by rajesh peter
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid