M
mAbZ
I have trouble getting an object reference from aspx in c# code.
I have 2 User Controls created in an aspx page:
....
<MyNamesp:MyControl1 ID="ctrl1" runat="server" ParentWindow="<%# this %>" />
<MyNamesp:MyControl2 ID="ctrl2" runat="server" Args="<%# ctrl1 %>" />
....
I also have 2 corresponding classes with their public properties
ParentWindow and Args respectively.
The objects "this" and "ctrl1" are instantiated but while
debugging I see that their values in each property setter are null.
The instantiated object "stays" so to speak on the aspx page.
Why? I would appreciate any ideas.
P.S.
Instatiating those objects in C# instead is working but not an option,
I need to do it like above.
I have 2 User Controls created in an aspx page:
....
<MyNamesp:MyControl1 ID="ctrl1" runat="server" ParentWindow="<%# this %>" />
<MyNamesp:MyControl2 ID="ctrl2" runat="server" Args="<%# ctrl1 %>" />
....
I also have 2 corresponding classes with their public properties
ParentWindow and Args respectively.
The objects "this" and "ctrl1" are instantiated but while
debugging I see that their values in each property setter are null.
The instantiated object "stays" so to speak on the aspx page.
Why? I would appreciate any ideas.
P.S.
Instatiating those objects in C# instead is working but not an option,
I need to do it like above.