To call a server event after you click on menu item you need to use,
as you can see inside the suite example, an invisible button:
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" style="display:none" />
Also a helpful control is a hidden input for storing the id of the clicked menu item:
<input type="hidden" id="Hidden1" runat="server" />
The server event that is called is the event that is triggered when the button is clicked
(currently not allowed because is not visible):
protected void Button1_Click(object sender, EventArgs e)
{
...some code...
}
The last important thing is the client event triggered by the menu item.
The event is set using menu item server property "OnClientClick":
<oem:MenuItem InnerHtml="<b>Server event 1</b>" ID="menuItem2" OnClientClick="CallServerEvent('menuItem2')"></oem:MenuItem>
Client-side event
function CallServerEvent(argument)
{
// store the clicked item id
document.getElementById('<%=Hidden1.ClientID %>').value = argument;
// call the server side event (same as button click)
<%= Page.ClientScript.GetPostBackEventReference(this.Button1, "") %>
}
Mouse over the gray box to see the menu.
Clicking on the second and third item in the menu will cause a postback to server.