Controlling a dropdown list from a separate user control

Discussion in 'ASP .Net' started by Iams, Feb 17, 2005.

  1. Iams

    Iams Guest

    I have one form, with 2 user controls. How can I get the procedures on uc2
    to modify a drop down list on uc1?

    I tried various versious of this in uc2:
    uc1.ddl.SelectedIndex =
    uc1.ddl.Items.IndexOf(uc1.ddl.Items.FindByValue(Session("ContactID")))

    The end result being a user selects something in uc2, I want the drop down
    list in UC1 to be updated as a result.
     
    Iams, Feb 17, 2005
    #1
    1. Advertising

  2. Iams

    Wilco Bauwer Guest

    If a usercontrol is not independent (which it isn't in this case), I
    would probably go for raising an event. A container which knows about
    the relevant usercontrols could then be a "mediator", e.g: take care of
    handling an event of 1 control and doing stuff with another control.

    I can see several cases where you'd like to be able to do stuff in 1
    usercontrol based on input from another usercontrol. For that reason,
    we (Variomatic) created a solution with a connection mechanism. This
    allows you to connect different "webparts" (which in the end are equal
    to usercontrols). Usercontrols can handle events of consumer connection
    points, which are raised when a provider connection point provides
    "data". You can read more about this on
    http://wilcoding.xs4all.nl/wilco/articles.aspx.

    Both Sharepoint and ASP.NET 2.0 have a connection mechanism aswell,
    although I personally dislike Sharepoint's implementation (too much
    plumbing needed).
     
    Wilco Bauwer, Feb 17, 2005
    #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. EvgueniB
    Replies:
    1
    Views:
    654
    Anthony Borla
    Dec 15, 2003
  2. Frank Fredstone
    Replies:
    1
    Views:
    459
    Jean-Francois Briere
    Jun 27, 2006
  3. Gonnasi
    Replies:
    6
    Views:
    376
    Gonnasi
    Oct 24, 2005
  4. jdp
    Replies:
    5
    Views:
    338
  5. M. Craig
    Replies:
    1
    Views:
    759
    Victor Garcia Aprea [MVP]
    Jan 9, 2004
Loading...

Share This Page