2 User Controls on a page need to talk.

Discussion in 'ASP .Net' started by UJ, May 27, 2005.

  1. UJ

    UJ Guest

    I have two user controls on a page. When a user selects something from one,
    the other one has to react. How do I go about this?

    TIA.

    Jeffrey.
    UJ, May 27, 2005
    #1
    1. Advertising

  2. UJ

    vMike Guest

    "UJ" <> wrote in message
    news:%...
    > I have two user controls on a page. When a user selects something from

    one,
    > the other one has to react. How do I go about this?
    >
    > TIA.
    >
    > Jeffrey.
    >
    >

    Here is how I would handle it. There may be other ways.
    Page1 has controlA and ControlB. In Page1 declare the controls "withevents".
    In ControlA you need an event which can be raised, say ControlA_Click. In
    ControlB you need a property which can be set. In Page1 you need a process
    to handle the ControlA_Click event. In that process you set the property of
    controlB. If you need to pass a value then you can pass it in an event
    argument.

    Mike
    vMike, May 27, 2005
    #2
    1. Advertising

  3. UJ

    Karl Seguin Guest

    Jeffrey:
    Take a look at:
    http://www.openmymind.net/index.aspx?documentId=9

    You'll find that there are a couple method, either accessing the data
    directly or using custom events. But in either case, the user controls need
    to go through the page in order to access each other.

    Karl

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/ - New and Improved (yes, the popup is
    annoying)
    http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
    come!)
    "UJ" <> wrote in message
    news:%...
    >I have two user controls on a page. When a user selects something from one,
    >the other one has to react. How do I go about this?
    >
    > TIA.
    >
    > Jeffrey.
    >
    Karl Seguin, May 27, 2005
    #3
    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. Alvin Bruney
    Replies:
    0
    Views:
    368
    Alvin Bruney
    Jan 17, 2004
  2. Jim Isaacson
    Replies:
    5
    Views:
    590
    Default User
    Nov 5, 2004
  3. Scamps

    Help: Getting two controls to talk etc.

    Scamps, May 5, 2005, in forum: ASP .Net Building Controls
    Replies:
    6
    Views:
    105
    Scamps
    May 12, 2005
  4. George Leithead

    Advice Needed: Three Web controls talk to each other?

    George Leithead, Jun 28, 2006, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    179
    George Leithead
    Jul 12, 2006
  5. Phrogz
    Replies:
    4
    Views:
    212
    Austin Ziegler
    Sep 6, 2006
Loading...

Share This Page