New to Telerik UI for ASP.NET AJAX? Download free 30-day trial


The OnClientLoadclient-side event occurs when the menu is first loaded and fully initialized on the client.

The event handler receives a single parameter: a reference to the client-side menu object.

You can use this event to perform your own initialization to the menu when it is loaded, or to save a reference to the menu in a global variable for reference from within your client-side code.

The following example illustrates the use of the OnClientLoad event handler for saving a reference to the client-side object:

<script type="text/javascript">
    var menu1;
    function StoreMenuClientObject(sender) {
        menu1 = sender;

    function UtilizeMenuClientObject() {

<telerik:RadMenu RenderMode="Lightweight" ID="RadMenu1" runat="server" OnClientLoad="StoreMenuClientObject">
        <telerik:RadMenuItem runat="server" ExpandMode="ClientSide" Text="One" />
        <telerik:RadMenuItem runat="server" ExpandMode="ClientSide" Text="Two" />
        <telerik:RadMenuItem runat="server" ExpandMode="ClientSide" Text="Three" />
<input id="Button1" type="button" onclick="UtilizeMenuClientObject()" value="button" />

The technique illustrated here can be used when the menu is nested within another control, but the RadMenu must be rendered only once. For example, you can use this approach if RadMenu is nested in a toolbar template button. However, if RadMenu is nested in a grid with more than one row, the method fails since there will be multiple instances of the rendered menu.

See Also

In this article