Issues with DDL postback on dynamically loaded ASCX

Discussion in 'ASP .Net Web Controls' started by AC [MVP MOSS], Sep 24, 2007.

  1. To start, this is for use within a SharePoint v3 site, but the concept is
    really core ASP.NET 2.0 development, so after striking out, I'm hoping
    someone here has an idea... thinking I'm having a core page lifecycle issue
    here...

    Creating a control that contains a DDL for countries, DDL for states & TXB
    for regions. If the user selects USA, the stateDDL should be visible and the
    TXB should be hidden... otherwise vice versa. Pretty simple. However, what's
    challenging here is that the control doesn't load like you're used to (ASCX
    then code behind with auto wireup). Rather, the class is loaded first and
    contains a property that tells the framework which ASCX to load. Once loaded,
    the CreateChildControls() is fired where you can get references to the
    controls on the page. No problem so far.

    Problem though is that when the event handler for the
    DDL_SelectedIdexChanged event is raised, it ~always~ says the selected index
    is 0. Tracing the code, the CreateChildControls() method runs first, THEN the
    event haldner runs... as expected... but the viewstate should have been
    parsed and the value should have been set on the DDL... but it isn't.

    Ideas?

    --
    -AC [MVP MOSS]
    http://www.andrewconnell.com
    http://www.andrewconnell.com/mvp
    http://www.andrewconnell.com/blog
     
    AC [MVP MOSS], Sep 24, 2007
    #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. Marina
    Replies:
    0
    Views:
    946
    Marina
    Aug 12, 2003
  2. Peter Jaffe
    Replies:
    0
    Views:
    1,202
    Peter Jaffe
    Feb 4, 2004
  3. kw
    Replies:
    5
    Views:
    3,208
    S. Justin Gengo
    Jul 16, 2004
  4. Alan Silver
    Replies:
    6
    Views:
    2,906
    Alan Silver
    Aug 9, 2005
  5. ASCX User Controls and DDL.SelectedValue

    , Oct 19, 2005, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    235
Loading...

Share This Page