How to ensure "child" ascx control loads before parent Load

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jaffarkazi

    How to ensure "child" ascx control loads before parent Load

    Hi,
    I have a .ascx control which holds company information which can be
    edited. One of the controls inside this is an Address control. The
    address control has country and state dropdowns loaded. When I open
    the page in edit mode, I want the company control to pre-select the
    country and database from the address control.

    However, the address control is being loaded after the parent.
    Therefore, the state and country dropdowns do not have the correct
    data till the end.

    How do I go about this?

    Thanks in advance,
    --Jaffar
  • Teemu Keiski

    #2
    Re: How to ensure "child&quo t; ascx control loads before parent Load

    Hi,

    you could use events to communicate between the controls, to signal when
    something can be done. The other control could subscribe to address
    control's Load event and do the thing when it's loaded (Load event is
    raised)? Or in case "readiness" is signaled by some action, raise custom
    event when it's done, the other control subscribes to this event and does
    its job. I'm not perhaps getting your case here 100%, but the idea of using
    events applies



    --
    Teemu Keiski
    AspInsider, ASP.NET MVP





    "jaffarkazi " <jaffar.kazi@gm ail.comwrote in message
    news:3670c92d-ef9e-4cb5-ab84-d2a0fbb4b1be@u3 6g2000prf.googl egroups.com...
    Hi,
    I have a .ascx control which holds company information which can be
    edited. One of the controls inside this is an Address control. The
    address control has country and state dropdowns loaded. When I open
    the page in edit mode, I want the company control to pre-select the
    country and database from the address control.
    >
    However, the address control is being loaded after the parent.
    Therefore, the state and country dropdowns do not have the correct
    data till the end.
    >
    How do I go about this?
    >
    Thanks in advance,
    --Jaffar

    Comment

    Working...