Table of Contents
  • Getting Started
  • EO.Pdf
  • EO.Web
    • Overview
    • Installation & Deployement
    • EO.Web ToolTip
    • EO.Web Rating
    • EO.Web Slider & RangeSlider
    • EO.Web ListBox
    • EO.Web ComboBox
    • EO.Web Captcha
    • EO.Web ASPX To PDF
    • EO.Web Slide
    • EO.Web Flyout
    • EO.Web EditableLabel
    • EO.Web ImageZoom
    • EO.Web Floater
    • EO.Web Downloader
    • EO.Web ColorPicker
    • EO.Web HTML Editor
    • EO.Web File Explorer
    • EO.Web SpellChecker
    • EO.Web Grid
    • EO.Web MaskedEdit
    • EO.Web Splitter
    • EO.Web Menu
    • EO.Web Slide Menu
    • EO.Web TabStrip
    • EO.Web TreeView
    • EO.Web Calendar
    • EO.Web Callback
    • EO.Web MultiPage
    • EO.Web Dialog
    • EO.Web AJAXUploader
    • EO.Web ProgressBar - Free!
    • EO.Web ToolBar - Free!
  • EO.WebBrowser
  • EO.Wpf
  • Common Topics
  • Reference
Handling Server Side Events

Apply to

Menu, SlideMenu, TabStrip and TreeView

Overview

EO.Web navigation controls raise several events on server side including all the standard WebControl events and the following events:

ItemClick Event

ItemClick event is the default event. It occurs when a navigation item is clicked and the item is configured to raise server event.

By default, clicking on navigation item does not raise server event. Either the control' RaisesServerEvent or the item's RaiseServerEvent needs to be set properly in order to post back server event. Use the control's RaisesServerEvent if you want all items in the control to raise server event; use item's RaisesServerEvent if you want to control each item individually.

To create a server side event handler:

  1. Select the control on your page;
  2. Press F4 to display the property window. Go to the event tab, double click on ItemClick. Visual studio .NET will generate the event handler body for you.
Here is an example of the event handler body:
private void Menu1_ItemClick(object sender, 
    EO.Web.ItemClickEventArgs e)
{
}

Use e.NavigationItem to refer the item that raised the event. For example, use e.NavigationItem.ItemID to get the ID of the navigation item that is clicked by user. You can also the NavigationItem to a specific type if you know the item type. For example, if the navigation control is a menu, you can case e.NavigationItem to MenuItem.

When both client event and server event handler are defined, client event handler is executed before server event handler.

ItemCreated Event

When a new navigation item is created during data binding, EO.Web navigation controls raise ItemCreated event. The event argument contains a reference to the newly created navigation item. Use this event to modify the custom item before it is rendered.

When the custom item contains other server controls and you want to handle those controls' server side event, you should hook up those controls' event handler in ItemCreated event.

CustomItemCreated Event

EO.Web navigation controls raise CustomItemCreated event when an embedded custom item is created. An embedded custom item is created for each navigation item that has a declared embedded custom item or each navigation item created during data binding that are based on a template item that has a declared embedded custom item. Use this event to modify the custom item before it is rendered.

Refer to custom item for more information.

ItemDataBound Event

EO.Web navigation controls raise ItemDataBound event when a navigation item is bound to a data item. Use this event and item's DataItem property together to make changes to the navigation item corresponding to the data source.