<%@ Page language="c#" src="TreeFrame.aspx.cs" AutoEventWireup="false" Inherits="TreeFrame" %>
<%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %>
<%--
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Microsoft.Web.UI.WebControls;
public class TreeFrame : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label1;
protected Microsoft.Web.UI.WebControls.TreeView TreeView1;
private void Page_Load(object sender, System.EventArgs e)
{
if (!this.IsPostBack)
{
Microsoft.Web.UI.WebControls.TreeNode rootNode;
rootNode = AddNode("default.aspx", "My Site", "Folder",
TreeView1.Nodes);
AddNode("info.aspx", "Contact Page", "Page", rootNode.Nodes) ;
rootNode.Expanded = true;
rootNode = AddNode("links.aspx", "Links", "Folder",
TreeView1.Nodes);
AddNode("http://www.google.com", "Google", "Page",
rootNode.Nodes);
AddNode("http://www.rntsoft.com", "rntsoft.com", "Page", rootNode.Nodes);
AddNode("http://www.google.com", "Google", "Page",
rootNode.Nodes);
rootNode.Expanded = true;
}
}
private Microsoft.Web.UI.WebControls.TreeNode AddNode(string id, string text,
string type, Microsoft.Web.UI.WebControls.TreeNodeCollection nodeCollection)
{
Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
node.Text = text;
node.Type = type;
node.ID = id;
nodeCollection.Add(node);
return node;
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.TreeView1.SelectedIndexChange += new Microsoft.Web.UI.WebControls.SelectEventHandler(this.TreeView1_SelectedIndexChange);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void TreeView1_SelectedIndexChange(object sender, Microsoft.Web.UI.WebControls.TreeViewSelectEventArgs e)
{
Microsoft.Web.UI.WebControls.TreeNode selectedNode = TreeView1.GetNodeFromIndex(e.NewNode);
string url = selectedNode.ID;
// Use JavaScript to trigger the redirect in the other window.
string frameScript = "";
Page.RegisterStartupScript("FrameScript", frameScript);
}
}
--%>