This project is read-only.

Quick Start Guide

Note that the full documentation behind this menu is at:
http://www.syrinxcs.org/dox/SiteMenu

Note: Regardless of ASP.NET WebForms or MVC, you need to add a reference to the SyrinxMenuV3.dll

Using the Control - ASP.NET MVC

1. At the top of the page or layout template, create the menu control and setup its properties:
@{
    Syrinx2.MvcMenu menu = new Syrinx2.MvcMenu("defaultMainMenu", 
                                               (val) => Url.Content(val))
    {
        PrimaryCssClass = "syrinx-menu",
        CssClass = "MainMenu",
        SubMenuCssClass = "MainMenuSubMenu",
        ItemCssClass = "MainMenuItem",
        SubMenuItemCssClass = "MainMenuSubMenuItem"
    };
}


2. Render the menu in the html where needed:

@Html.Raw(menu.Html) 


3. Add the syrinx menu JavaScript to a bundle in the site's BundleConfig.cs (also ensure the syrinx menu js should placed within your Scripts directory):

bundles.Add(new ScriptBundle("~/bundles/syrinxmenu").Include("~/Scripts/jquery.syrinxmenu.js")); 


4. Ensure the bundle is included on your page or layout template. You can typically update the Scripts.Render call that has jquery to include the syrinxmenu bundle too:

@Scripts.Render("~/bundles/jquery", "~/bundles/syrinxmenu")


5. Add folder named menus with an xml file named defaultMainMenu.xml that contains the following xml for the main menu:

<Menu id="defaultMainMenu" >
  <MenuItem text="Home" navigateUrl="~/Home/Index" />
  <MenuItem text="About" navigateUrl="~/Home/About" />
  <MenuItem text="Contact" navigateUrl="~/Home/Contact" />
  <MenuItem text="Sites">
    <MenuItem text="Syrinx CS" navigateUrl="http://syrinxcs.org" target="_blank" />
    <MenuItem text="Kusog Libraries" navigateUrl="http://kusog.org" target="_blank" />
    <MenuItem text="Dev Instruct" navigateUrl="http://devinstruct.com" target="_blank" />
  </MenuItem>
</Menu>

Last edited Nov 8, 2013 at 7:07 PM by MattFromGA, version 16

Comments

schavali Jan 8, 2014 at 6:43 AM 
I have a MVC4 application. I did all the steps exactly as mentioned above, but I am not able to see menu when I run the application. How does _Layout file knows that it has to read from that specific xml file? Am I missing something here. Please help!

48694104 Dec 19, 2013 at 9:20 AM 
Hi, this menu control is great! How to set values in *.cs page? SyrinxMenu1.Item.Add(??)

rline Dec 4, 2013 at 5:23 AM 
Incredible. I managed to make it show a menu in 10 min. Other websites show very complex examples, while this one is so easy.
However, for some reason my menu doesn't show any children e.g. <MenuItem text="Syrinx CS", etc. I wonder what I have done wrong?

rahul1984 Nov 14, 2013 at 9:10 AM 
Can you please help to implement?

BartClare Nov 8, 2013 at 7:29 PM 
Also -- the sample project is excellent!!

BartClare Nov 8, 2013 at 7:25 PM 
This works great! I can't believe how quickly I was able to get this working, despite being a relative neophyte at web work. I also got very prompt and helpful support from the developer, MattFromGA! Highly recommended