C
Chris Smith
Hi
I am getting what appears to me as incorrect behavior from my server
control, but maybe its just that I don't fully understand the relationships
involved.
Here's the issue:
I have a templated server control that overrides CreateChildren() method.
However, if the control is hidden at page load (Visible="False" in the tag
definition), the CreateChildren method doesn't seem to fire. That's fine. I
wouldn't expect it to fire since its hidden.
However, when I then set the control's visibility to true (inside a method
on the page), the objects that should have been read from the template are
still not available (they are <undefined>). If, on the other hand, I always
set the control to be visible, everything works fine.
To make this an easy flow, imagine it like this:
Templated Server control, hidden on the ASPX page.
If control is visible, then it runs the CreateChildren() method
automatically to get the objects it needs from the template.
If the control is hidden at startup, then MADE visible inside page code, the
CreateChildren() never fires, so any operations done on objects that should
have been created in CreateChildren are unavailable.
Some help would be great on this one.
I am getting what appears to me as incorrect behavior from my server
control, but maybe its just that I don't fully understand the relationships
involved.
Here's the issue:
I have a templated server control that overrides CreateChildren() method.
However, if the control is hidden at page load (Visible="False" in the tag
definition), the CreateChildren method doesn't seem to fire. That's fine. I
wouldn't expect it to fire since its hidden.
However, when I then set the control's visibility to true (inside a method
on the page), the objects that should have been read from the template are
still not available (they are <undefined>). If, on the other hand, I always
set the control to be visible, everything works fine.
To make this an easy flow, imagine it like this:
Templated Server control, hidden on the ASPX page.
If control is visible, then it runs the CreateChildren() method
automatically to get the objects it needs from the template.
If the control is hidden at startup, then MADE visible inside page code, the
CreateChildren() never fires, so any operations done on objects that should
have been created in CreateChildren are unavailable.
Some help would be great on this one.