ASP.NET1.1: Event sequence (Page vs. Control)?

Discussion in 'ASP .Net Web Controls' started by Ole Hanson, Nov 16, 2004.

  1. Ole Hanson

    Ole Hanson Guest

    Hi

    I am having a number of User Controls (ascx) on my page (aspx).
    The page is in my scenario only working as a dumb "container "giving life to
    the Controls, as these are handling my UI-logic and communicating with each
    other (the controls are communicating) by subscribing to each others events.
    (e.g. pressing a selection in Control1 will "trigger" the content of
    Control2).

    It is done in this way:
    I wire up Control2 to subscribe to events from Control1. This is done in the
    Page_Load event of Control2, by first letting Controls2 obtain access to
    it's parent (this.Page.Controls) and then locating Control1's events to
    subscribe to. It is a quite brilliant framework letting the UI-controls
    communicate via the page.

    Question: How to I make sure the controls are loaded by the hosting Page,
    before doing the eventwiring (Subscribe)??


    /Ole
     
    Ole Hanson, Nov 16, 2004
    #1
    1. Advertising

  2. Ole Hanson

    Anders Borum Guest

    Hello!

    If the controls are hardcoded (e.g. by server side tag declarations), they
    all participate in the control hierarchy and follow the normal control
    lifecycle.

    Basically you would want to ensure that the controls are available in the
    control hierarchy with the same identifiers regardless of dynamic or static
    instantiation (the UniqueID property of each control - ensured by the server
    side tag declarations or by programmatic control).

    If the controls are positioned with the same identifiers, they should be
    able to respond to your events.

    The wiring you've described is possible, but I would probably host the two
    controls in a third parent control and handle the events there, then call
    respective methods on either child control.

    --
    venlig hilsen / with regards
    anders borum
    --
     
    Anders Borum, Nov 16, 2004
    #2
    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. bb
    Replies:
    2
    Views:
    378
  2. Andrea Raimondi
    Replies:
    1
    Views:
    476
  3. =?Utf-8?B?ZGF2aWQ=?=

    TreeView control for web form in .NET1.1?

    =?Utf-8?B?ZGF2aWQ=?=, Mar 31, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    4,393
    Velocity_User
    Mar 14, 2008
  4. karch

    Printing from ASP.NET1.1

    karch, May 30, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    1,843
    karch
    May 30, 2006
  5. Replies:
    1
    Views:
    502
    Mark Rae
    Feb 13, 2007
Loading...

Share This Page