View Full Version : Menupanel onselecteditemchanged event in version 0.8

Apr 02, 2009, 11:09 AM

Is it me or this event does not fire on the server side on version 0.8?
bellow I have provided a very simple code sample;

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebCooliteTest._Default" %>

<%@ Register assembly="Coolite.Ext.Web" namespace="Coolite.Ext.Web" tagprefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<link href="Styles/Stylesheet1.css" rel="stylesheet" type="text/css" />
<form id="form1" runat="server">

<ext:ScriptManager ID="scriptManager1" runat="server" Theme="Gray" />
<ext:MenuPanel ID="MenuPanel1" runat="server" Height="300" Title="Menu"
Width="180" Cls="menuSelected" onselecteditemchanged="MenuPanel1_SelectedItemChanged" SelectedIndex="0">
<menu id="ctl35" >
<ext:MenuItem runat="server" Text="Item1" ID="ctl36">
<ext:Menu runat="server" ID="ctl37">
<ext:MenuItem runat="server" Text="SubItem1" ID="ctl38" />
<ext:MenuItem runat="server" Text="SubItem2" ID="ctl39" />
<ext:MenuItem runat="server" Text="Item2" ID="ctl40" />
<ext:MenuItem runat="server" Text="Item3" ID="ctl41" />
<ext:MenuItem runat="server" Text="Item4" ID="ctl42" />


Server side event

protected void MenuPanel1_SelectedItemChanged(object sender, EventArgs e)
string test = string.Empty;
test = "test";

Thank you in advance,

Apr 02, 2009, 11:30 AM

Please note that OnSelectedItemChanged is called when request to server performed (postback or ajax event). You need to initiate postback or ajax event to call it.

You can use ItemClick ajax event of Menu to call server side function when menu item was clicked