Custom controls instance problem on PostBack - two controls, one instance ???

Discussion in 'ASP .Net Web Controls' started by Dejan Vesic, Aug 20, 2003.

  1. Dejan Vesic

    Dejan Vesic Guest

    Hello.

    I created custom control, based on standard DropDownList control.
    It is simple extension of the control, with couple of methods added.

    My page has two instances of control, let`s say UserDDL1 and
    UserDDL2

    Now, when page is drawn for the first time, everything works as
    expected. But, if I try something like this in PostBack:

    UserDDL1.SelectedIndex = 5;
    UserDDL2.SelectedIndex = 8;

    BOTH controls keep last assigment for .SelectedIndex !!! (8) as if
    those controls are reference to the same object instance!

    I could not find any problems on code side (C#) or in ASPX page.

    Any advice or idea?

    Regards,
    Dejan Vesic

    Platform: VS 2003, .Net Framework 1.1
    Dejan Vesic, Aug 20, 2003
    #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. news.frontiernet.net
    Replies:
    6
    Views:
    1,118
    news.frontiernet.net
    Apr 16, 2004
  2. GenxLogic
    Replies:
    3
    Views:
    1,263
    andrewmcdonagh
    Dec 6, 2006
  3. egyedg
    Replies:
    0
    Views:
    353
    egyedg
    Mar 11, 2009
  4. anon
    Replies:
    0
    Views:
    208
  5. Tobias Müller
    Replies:
    0
    Views:
    112
    Tobias Müller
    Dec 9, 2013
Loading...

Share This Page