O
Ofer Zelig
I'll describe the simplest situation of the problem.
I have a simple Web User Control which only contains a: <div id="bla"
runat="server" /> .
I dynamically add it to a page, by performing:
SomeCtl ctl = new SomeCtl();
this.Controls.Add(ctl);
and of course apply a <% @ Register %> tag in order to make SomeCtl known to
the page (is there some more elegant way?).
I override OnPreRender of the control, in order to write some stuff to the
DIV according to some property of the control, but I can't (within the
event code) access the DIV. It is equal to null.
The issue happens of course only when my user control (SomeCtl) is added
dynamically to the page, and not when I place the user control directly
within the page at design time.
Thanks in advance for your help,
Ofer
I have a simple Web User Control which only contains a: <div id="bla"
runat="server" /> .
I dynamically add it to a page, by performing:
SomeCtl ctl = new SomeCtl();
this.Controls.Add(ctl);
and of course apply a <% @ Register %> tag in order to make SomeCtl known to
the page (is there some more elegant way?).
I override OnPreRender of the control, in order to write some stuff to the
DIV according to some property of the control, but I can't (within the
event code) access the DIV. It is equal to null.
The issue happens of course only when my user control (SomeCtl) is added
dynamically to the page, and not when I place the user control directly
within the page at design time.
Thanks in advance for your help,
Ofer