Using skmMenu
Getting Started
So, you've downloaded skmMenu and are ready to start using it in your ASP.NET
Web applications. First things first - if you have downloaded the source code
download, compile the project into an assembly (a .dll file). The
easiest way to do this is to use Visual Studio .NET. (Note: the VS.NET
Project file included with the skmMenu download is for Visual Studio .NET 2003.
If you are using Visual Studio .NET 2002 you'll need to create a new project
and manually move over the files into your project... See this FAQ
for more information...)
If You Are Using Visual Studio .NET
To get started, create a new ASP.NET Web application using either VB.NET, C#,
or J#. Next, open an ASP.NET Web page in Design mode. You can now add skmMenu
to the Visual Studio .NET Toolbox. In Visual Studio .NET 2003, just right-click
on the Toolbox and choose to Add/Remove Items. (In Visual Studio .NET 2002,
right-click on the Toolbox and choose Customize Toolbox.)
This will display a dialog box with two tabs:
- .NET Framework Components
- COM Components
Make sure the .NET Framework Components tab is selected and then click the Browse button.
Navigate to the skmMenu.dll assembly, and click OK. This will add a Menu
item to your Toolbox. At this point, you can add skmMenu to an ASP.NET Web page by simply
dragging and dropping the Menu from the Toolbox onto the Designer. You can then tweak its
properties through the Properties pane.
You will also need to add skmMenu to the Project's References folder. To accomplish this,
right-click on the References folder in the Solution Explorer and choose Add Referene. Then navigate
to the skmMenu.dll assembly and click OK.
If You Are Not Using Visual Studio .NET
If you are not using Visual Studio .NET, download the binary version
of skmMenu. This will include the file skmMenu.dll. Copy this file to
your Web application's /bin directory. To add skmMenu to
an ASP.NET Web page, open the Web page and add at the top of the page:
<%@ Register TagPrefix="skm" Namespace="skmMenu" Assembly="skmMenu" %>
Then, wherever you want the skmMenu to appear in your page, add the following:
<skm:Menu id="id" runat="server" ...></skm:Menu>
Creating a Menu
To use skmMenu you must either programmatically create the elements of the menu or
bind an XML file to the skmMenu control. The simplest approach is to bind an XML file to
the menu; in fact, the menus you see on this site use XML files. While XML files are the
simplest approach, they also suffer from being static - that is, if you need to display
menu items based on, say, user permissions, then you'll want to programmatically build the
menu.
There are examples available that illustrate both how to bind an XML file to the menu control
and how to build one up programmatically. The Stylin' XML
Demo - available online - shows how to bind an XML file to the menu. If you
download the skmMenu examples package, there are a couple of examples
that illustrate programmatically creating a menu.
One question you might have when creating an XML file is, "What must be the structure of the XML
document that is bound to the menu?" To answer this question, read:
Examining the XML Structure.
|