APNSoft - Web Controls, components for ASP.NET Home Help Center Contact Us
About UsProductsDownloadsPurchase
Support

Menu
Version 3.5



What's New
Overview
Features
Reference Book
Licensing
Support



Populating with Data
Appearance
Layout
Behavior
Programming




Installation

To install APNSoft Menu on your machine download and run the distributive APNSoftMenu.msi. The .MSI installers are intended for easy and automatic installation of a product. The .MSI installs the control on your computer to a folder named APNSoft in your Program Files and automatically creates the necessary virtual folder. After installation procedure you can open the page with Reference Book, Code Samples, Online Examples, etc. by this shortcut:

Start Menu -> Programs -> APNSoft Menu ->


Visual Studio .NET Integration

The installer creates Visual Studio .NET toolbox item for APNSoft Menu. This item is visible under the APNSoft tab when you open a new or existing ASP.NET Web application and when you create or edit an ASPX page.


Manually adding the Menu to your Visual Studio .NET

To add the APNSoft Menu control to your Visual Studio project please follow these steps:

  1. Open the toolbox.
  2. Right click it and open Choose Items ... (Add/Remove Items).
  3. Click Browse in the dialog;
  4. Find the APNSoftMenu.dll assembly, select Open and then Ok. After installation, the file APNSoftMenu.dll is in the C:\Program Files\APNSoft\APNSoft Menu [version] for ASP.NET [version]\bin\ folder by default.

    APNSoftMenu component will appear in toolbox and you can add it to a page:

Adding Menu to your web application using Visual Studio

Drag the APNSoftMenu component icon from the toolbox and drop it in your web form / web user-control. Visual Studio will automatically copy the APNSoftMenu.dll to the bin folder of your web application and will create the respective Reference.

All of the properties are listed in the properties panel in Visual Studio and can be grouped:



Manually embedding the Control into the page
  1. Copy the APNSoftMenu.dll assembly into the bin directory of your web application.
  2. Add the following line of code (without line breaks) to the top of your page:

    <%@ Register TagPrefix="mn" Namespace="APNSoft.WebControls" Assembly="APNSoftMenu" %>

  3. Add the following line of code anywhere within your page to embed the Menu:

    <mn:APNSoftMenu id="m1" runat="server" />
    

    Now you can open the page in your browser to see output.

Launching the Menu from Code Behind

For more programming flexibility you can use the built-in API of APNSoft Menu which provides various methods simplifying dynamic Menu creation.

We recommend to use the PlaceHolder as a container to store dynamically added server controls on the Web page. The PlaceHolder is a standard Web Forms control.
  1. Put the PlaceHolder somewhere on your Web page

    <asp:PlaceHolder id="PlaceHolder1" runat="server" />
    


  2. Put code in Code Behind

    [C#]
    
    using APNSoft.WebControls;
    
    //(step 1)Create component instance
    APNSoftMenu myMenu = new APNSoftMenu();
    myMenu.BasePage = base.Page;
    myMenu.ID = "mn1";
    
    //(step 2)Set component properties
    myMenu.StructureFileURL="~/Structures/Menu_Top.xml";
    myMenu.ClientScriptSource =
      APNSoftMenu.ClientScriptSourceValues.ExternalFile;
    
    //(step 3)Add the Menu component to PlaceHolder
    PlaceHolder1.Controls.Add(myMenu);
    
    
    [VB.NET]
    
    Imports APNSoft.WebControls
    
    '(step 1)Create component instance
    Dim myMenu As APNSoftMenu = New APNSoftMenu
    myMenu.BasePage = Me.Page
    myMenu.ID = "mn1"
    
    '(step 2)Set component properties
    myMenu.StructureFileURL = "~/Structures/Menu_Top.xml"
    myMenu.ClientScriptSource = _
      APNSoftMenu.ClientScriptSourceValues.ExternalFile
    
    '(step 3)Add the Menu component to PlaceHolder
    PlaceHolder1.Controls.Add(myMenu)
    






  © 2003-2008 APNSoft. All rights reserved. Table of Contents   Terms of use   Contact Us   Help Center