Object references from aspx to C#

I

Iza

Hi

I'm trying to instantiate 2 UserControls in an aspx page:
....
<MyNamespace:MyControl1 ID="ctrl1" runat="server" ParentWindow="<%#
this %>" />
<MyNamespace:MyControl2 ID="ctrl2" runat="server" Args="<%# ctrl1
%>" />
....

I have 2 corresponding classes with their public properties
ParentWindow and Args respectively.
Now, what happens is that the classes are instantiated and
variables "this" and "ctrl1" are correctly initialized in aspx but
they are null when referenced in class properties. Why?

I would appreciate any ideas.
The objects are required to be created in this manner, in ASPX page,
so instatiating them in C# code is not an option.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,235
Latest member
Top Crypto Podcasts_

Latest Threads

Top