M
mAbZ
I have trouble getting an object reference from aspx to c# code.
I have 2 controls created in an aspx page:
....
<MyNamespace:MyControl1 ID="ctrl1" runat="server" ParentWindow="<%# this %>"
/>
<MyNamespace: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 is not an option,
I need to do it like above.
I have 2 controls created in an aspx page:
....
<MyNamespace:MyControl1 ID="ctrl1" runat="server" ParentWindow="<%# this %>"
/>
<MyNamespace: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 is not an option,
I need to do it like above.