Imports System.Data Imports MySql.Data.MySqlClient Partial Class MasterPage Inherits System.Web.UI.MasterPage Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not IsPostBack Then . . Build the treeview . . End If End Sub Protected Sub TreeView1_SelectedNodeChanged(ByVal sender As TreeView, ByVal e As System.EventArgs) Handles TreeView1.SelectedNodeChanged If Not sender.SelectedNode.Parent Is Nothing Then If sender.SelectedNode.Parent.Text.ToUpper.Contains(" GOAL") Then Response.Redirect("page1.aspx") Else Response.Redirect("page2.aspx") End If End If End Sub End ClassStarting the system brings up the following events
DefaultPage Load - Not isPostBack MasterPage Load - Not isPostBackClicking on one of the "GOAL" items in the treeview brings up the following events
DefaultPage Load - isPostBack MasterPage Load - isPostBack Treeview SelectedNodeChanged Page1 Load - Not isPostBack MasterPage Load - Not isPostBackThe problem for the moment is that the Treeview has been rebuilt and reloaded in its original state (no expansion)