A
abargaddon
Hi all,
I have derived the TreeNode class in order to have it templated, and
that works well. However, in the template I put a control (a link to a
menu) that refers to another control (the menu itself) in the page but
outside the template.
It does not work because the inner control (link to a menu) fails to
find the other control, which it searches in its Page attribute. It
looks like the Page property is null when in a template.
The code is in VB.NET, which I like less than C# :
Protected Overrides Sub AddAttributesToRender(ByVal writer As
System.Web.UI.HtmlTextWriter)
If Not (System.Web.HttpContext.Current Is Nothing) AndAlso Not
Me.Page Is Nothing AndAlso Me.Enabled AndAlso
Me.ContextMenuToOpen.Length > 0 Then
That test fails because Me.Page is Nothing.
So, how can I set the Page attribute of each TreeNode, or access the
TreeView object from the TreeNode object ?
Thanks in advance,
Abargaddon
I have derived the TreeNode class in order to have it templated, and
that works well. However, in the template I put a control (a link to a
menu) that refers to another control (the menu itself) in the page but
outside the template.
It does not work because the inner control (link to a menu) fails to
find the other control, which it searches in its Page attribute. It
looks like the Page property is null when in a template.
The code is in VB.NET, which I like less than C# :
Protected Overrides Sub AddAttributesToRender(ByVal writer As
System.Web.UI.HtmlTextWriter)
If Not (System.Web.HttpContext.Current Is Nothing) AndAlso Not
Me.Page Is Nothing AndAlso Me.Enabled AndAlso
Me.ContextMenuToOpen.Length > 0 Then
That test fails because Me.Page is Nothing.
So, how can I set the Page attribute of each TreeNode, or access the
TreeView object from the TreeNode object ?
Thanks in advance,
Abargaddon