B
Brooks Of Sheffield
I have written a composite treeview webcontrol. It has a "Filtered"
property. During the Render process, if the Filtered property is set
to True it will add a checkbox, if the Filtered is set to False it
should NOT add a checkbox.
If I put just one instance of the webcontrol on a page, it works as
expected.
But if I drop two of them, and then change the Filtered property of
the second one to True, BOTH of them render with checkboxes --
obviously I only want the second one too. How are the two getting
mixed up?
Another clue: the control overrides OnInit to track a couple objects:
OnInit ...
if PostBack.PostBack
_LastNodeClicked = Page.Session.Item("LNC")
The controls were "mixing up" the LNCs, each responding to the last
node clicked on the page, not the last node clicked on the specific
control. I added the "UniqueId" to the session variables and that
fixed that problem:
Page.Session.Add("LNC"+Me.UniqueID, N)
_LastNodeClicked = Page.Session.Item("LNC"+Me.UniqueID)
But I suspect that both behaviors are symptoms of the same underlying
(probably obvious?) problem. Does anyone know what I am doing wrong?
Thanks,
Brooks
property. During the Render process, if the Filtered property is set
to True it will add a checkbox, if the Filtered is set to False it
should NOT add a checkbox.
If I put just one instance of the webcontrol on a page, it works as
expected.
But if I drop two of them, and then change the Filtered property of
the second one to True, BOTH of them render with checkboxes --
obviously I only want the second one too. How are the two getting
mixed up?
Another clue: the control overrides OnInit to track a couple objects:
OnInit ...
if PostBack.PostBack
_LastNodeClicked = Page.Session.Item("LNC")
The controls were "mixing up" the LNCs, each responding to the last
node clicked on the page, not the last node clicked on the specific
control. I added the "UniqueId" to the session variables and that
fixed that problem:
Page.Session.Add("LNC"+Me.UniqueID, N)
_LastNodeClicked = Page.Session.Item("LNC"+Me.UniqueID)
But I suspect that both behaviors are symptoms of the same underlying
(probably obvious?) problem. Does anyone know what I am doing wrong?
Thanks,
Brooks