ASP.NET Slide Menu - Knowledge Base

« Back to Knowledge Base list

Automatically select the item the user has clicked on

Q:

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

A:

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 asselected.

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>