Slide Menu - Help and HOW-TOs




1. Why doesn't style change when mouse is over first parent in examples?

In almost all examples SelectedIndex property is set to the first parent's ID. That means that it is always selected first.


2. How can I have the menu automatically select the item user has clicked on?

1. You can define an OnClick event (.NET):
    <osm:Child id="c1" OnClick="someFunction">Click Me</osm:Child>

This will cause the page to postback when user clicks on this child. Menu will automatically mark the item that caused the postback as selected.

2. You can also set the menu to get SelectedId from query string on page load like so:
.NET:
    void Page_Load(object sender, EventArgs e) {
        menuID.SelectedId = Request.QueryString["sm"];
    }

Classic ASP:
    osm.AutoQueryString = true
    osm.SelectedId = Request.QueryString("sm")

Your URL's will have to look like this in .NET:
    <osm:Child id="c1" Url="http://www.obout.com/sm/page.aspx?sm=c1">Click Me</osm:Child>


3. Can you change the direction of the menu? I would like it horizontally.

No, this can not be done.


4. How can I use the menu with code behind?

Download Slide Menu with complete examples. Look at C# or VB.NET examples.
6. How to set dynamic height?

Set Height = -1 for dynamic height.


7. How to set URL target to different frame?

Use UrlTarget property to provide the name of the frame:
    osm.UrlTarget = "mainframe";


8. How to set selected menu item?

Use SelectedId property. Set it to the id of an item you want to select.
    osm.SelectedId = "p1";

.NET:
    <osm:SlideMenu id="sm1" SelectedId="c1"> . . .

Classic ASP:
    osm.AutoQueryString = true
    osm.SelectedId = Request.QueryString("sm")


9. How to install?

See our download page for details.


10. Where to put folder 'slidemenu'?

You can put this folder anywhere you wish.

In order to run examples, this folder must be at the root of your web server.


11. Can I trigger a sub when a user has seleted an item in the menu?

Yes, simply define the OnClick event handler:
    <osm:Child id="c1" OnClick="someFunction">Click Me</osm:Child>


12. I have 2 different menus on one page. How to select both?

In case of postback, both menus will remember their selected items and will retain them.

You can use two values in the query string for each of the menus. For example, "somepage.aspx?sm1=c3&sm2=c6"
Then, assign the values to each of the menus:
    osm1.SelectedId = Request.QueryString["sm1"];
    osm2.SelectedId = Request.QueryString["sm2"];
13. How to create new style?

You can change the look of every single part of the menu. To do this, menu has several properties that take in CSS class names.
  • CSSMenu - CSS class for the whole menu. (Generally, here you'd set width and outer border)
  • CSSChildrenBox - CSS class for a DIV that holds all children below the parent. Useful for defining padding, background color, border.
  • CSSParent - CSS class for each parent item. Each parent will have the style defined here.
  • CSSParentOver - class for a parent that has a mouse cursor over it.
  • CSSParentSelected - class for a parent which is currently selected. If KeepExpanded is set to true, then multiple parents can be marked as selected.
  • CSSChild - class for each child.
  • CSSChildOver - class for a child that has a mouse cursor over it.
  • CSSChildSelected - class for a child which is currently selected. Only one child can be selected at a time.
  • CSSImageParent - CSS class for every parent image. Usefull to define position of image relative to text and image margins.
  • CSSimageChild - same as CSSImageParent, only for child images.
All of these styles are optional, so defining all of them is not necessary.


14. How to put JavaScript to child?

Each parent and child have a property for client side script:
(It is also the last argument in AddParent and AddChild methods)
  • OnClientClick - javascript code to execute when user clicks on an item.
This proprety (and argument) is optional.


15. How to make menu look the same in all browsers?

Browser incompatibilities are bound to happen, so
- Pay attention to style definitions. Sometimes there is an alternative cross-browser way to do something.
- You could also define several styles for each browser and switch them depending on the browser used. For example, take a look at Windows XP Blue example in our Slide Menu download. File names are pro_blue.aspx, cs, vb, asp.


16. How to use different styles for menus on one page?

Simply assign different CSS class names to each of the menus.
17. How to define images for mouse over parent and children?

Menu has several properties that take in paths to images.
  • ImageParent - Image to use for every parent.
  • ImageParentOver - Image to use for a parent when the mouse cursor is over it.
  • ImageParentSelected - Image to use for a parent that is selected.
  • ImageChild - Image to use for every child.
  • ImageChildOver - Image to use for a child when the mouse cursor is over it.
  • ImageChildSelected - Image to use for a child that is selected.
All of these styles are optional.

Note: If you need to define a selected or over image, you need to define a regular image too (1px empty gif, for example).


18. How to add link to parent and open to frame?

1. See FAQ #7

2. You can use the following trick to add a target to url:
C#:
    osm.AddChild("c1", "click me", "http://www.obout.com\\\" target=\\\"mainframe", null);

Classic ASP:
    osm.AddChild "c1", "click me", "http://www.obout.com\"" target=\""mainframe"


19. I installed the dll, but the menu does not show on the page.

Menu needs an external javascript file to run. Slidemenu.js is in folder slidemenu/smscript

By default, menu will look at the root of your server in /slidemenu/smscript, so simply put folder slidemenu at the root of your web server.

You can also put the javascript file anywhere you wish. But then, you have to change ScriptPath property to point to the right directory.
For example, if I put slidemenu.js in myscripts directory, then ScriptPath = "myscripts"


20. I see scrollbars in the menu and height does not change. I thought height is adjusted dynamically?

By default, Height is set to 100. To make it dynamic, set Height = -1




22. I don't have access to wwwroot\bin, where should I put the DLLs?

You must put the DLLs into your application bin folder.

You can also add the control to your Visual Studio toolbox and simply drag it on the form.

Another option is to add a reference to the DLL by right clicking on References in Solution Explorer in Visual Studio and selecting Add Reference.


23. How can I add another control to a menu child programmatically?

To add another control to a child with ID "myChild":

osm.MenuItems.GetItemById("myChild").Controls.Add(control_to_add);


You can also add a control to the last added menu item:

osm.MenuItems[osm.MenuItems.Count - 1].Controls.Add(control_to_add);


24. How to run examples? I am new to web programming.

First install the component. See how to install.
Open IIS console.
Expand tree on left side down to your web site and see folder 'slidemenu/examples'.
On right side you will see list of example files.
Make right click on any file and select 'Browse' (not 'Open'!).


TIP: How to add reference to dll in Visual Studio project?

Go to toolbar menu Project > Add Reference > Click button 'Browse' >
> Find obout_SlideMenu3_Pro_Net.dll > Click 'Open' > Click OK

Note: You don't need to create VS project to run examples.


25. How to make all the slide menus display in an expanded state?

You can put several Slide Menus one under other.
Each menu should have only one parent.
They will look like one menu and you can have them all expanded.


26. How To delete trial version and install full version?
Search your hard drives for obout_slidemenu*.dll and delete all.
Make sure you are searching on the correct machine.
Then install the full version.
If you can't delete COM dll:

To unregister dll for ASP:
    regsvr32 "C:\<your-path>\obout_SlideMenu3.dll" -u
If access is denied when you delete dll, do this:
    1. Close InterDev and all other apps with references to dll.
    2. Open IIS MMC. Open Properties for your web site.
    3. Open tab 'Home Directory' and click button 'Unload'.
Now unregister and delete dll. If it doesn't help, reboot PC and delete file. 

On Windows 2003 click Start > Run > type IISReset.exe > Press OK > After reset replace dll.
or
On Windows 2003 go to IIS > Application Pools > Restart DefaultAppPool > Replace dll.

"I'm very happy with the obout suite. The product is excellent!"

Anfilofio Santos