Hi,
I have exactly the same code except formating, the event did fired in my test. Here is my full code:
ASPX code: TreeViewEvent.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TreeViewEvent.aspx.cs" Inherits="TreeViewEvent" %>
<!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">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TreeView ID="LinksTreeView" Font-Names="Arial" ForeColor="Blue" EnableClientScript="true"
PopulateNodesFromClient="true" OnTreeNodePopulate="PopulateNode" OnSelectedNodeChanged="Select_Change"
runat="server">
<Nodes>
<asp:TreeNode Text="Report" PopulateOnDemand="True" Value="Report" >
<asp:TreeNode Text="ChildNode" Value="ChildNode"></asp:TreeNode>
</asp:TreeNode>
</Nodes>
</asp:TreeView>
</div>
</form>
</body>
</html>
Code behind: TreeViewEvent.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class TreeViewEvent : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Select_Change(object sender, EventArgs e)
{
Response.Write("Hello");
}
protected void PopulateNode(object sender, EventArgs e)
{
Response.Write("World");
}
}
Could you check your page directive and code behind?
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TreeViewEvent.aspx.cs" Inherits="TreeViewEvent" %>
Zhao Ji Ma
Sincerely,
Microsoft Online Community Support
?Please remember to click ?Mark as Answer? on the post that helps you, and to click ?Unmark as Answer? if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ?