using System;
using System.Collections.Generic;
using System.Web;
using System.Collections.Specialized;
using System.Web.UI;
using System.Web.UI.WebControls;
public class CustomTreeNode : TreeNode
{
public CustomTreeNode()
: base()
{
}
///
/// used to store Node Attributes
///
private NameValueCollection _Attributes = new NameValueCollection();
///
///used to store the CSS Class applied to a node.
///
private string _cssClass;
///
/// Property used to set the CSS Class applied to a Node
///
public string cssClass
{
get { return _cssClass; }
set { _cssClass = value; }
}
///
/// Property used to add Attributes to a node
///
public NameValueCollection Attributes
{
get { return this._Attributes; }
set { this._Attributes = value; }
}
///
/// add additional rendering to the node
/// Add a div Tag and a class Attribute
///
/// represents the output stream used to write content to a Web page
protected override void RenderPreText(HtmlTextWriter writer)
{
writer.AddAttribute(HtmlTextWriterAttribute.Class, cssClass);
writer.AddAttribute(HtmlTextWriterAttribute.Onclick, "loadingShow(this)");
//執行取得座標的java函式
writer.RenderBeginTag(HtmlTextWriterTag.Div);
base.RenderPreText(writer);
}
///
/// add additional rendering to the node
/// End Tag
///
/// represents the output stream used to write content to a Web page
protected override void RenderPostText(HtmlTextWriter writer)
{
writer.RenderEndTag();
base.RenderPostText(writer);
}
}