User Control reference from aspx to C# ?

Discussion in 'ASP .Net Web Controls' started by mAbZ, Jul 18, 2007.

  1. mAbZ

    mAbZ Guest

    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.
    mAbZ, Jul 18, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?YWJqb3Jr?=
    Replies:
    1
    Views:
    3,813
    Jeffrey Palermo
    May 5, 2004
  2. Alain Sienaert

    Reference Delphi aspx page in VB.aspx

    Alain Sienaert, Jul 21, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    515
    Eliyahu Goldin
    Jul 22, 2004
  3. John M
    Replies:
    1
    Views:
    1,132
    Kumar Reddi
    May 29, 2005
  4. Mad Scientist Jr
    Replies:
    0
    Views:
    635
    Mad Scientist Jr
    Mar 22, 2006
  5. Jonathan Wood

    User Control to Control Other User Control

    Jonathan Wood, Jan 24, 2010, in forum: ASP .Net
    Replies:
    4
    Views:
    541
    Jonathan Wood
    Feb 2, 2010
Loading...

Share This Page