DropDownList Control within table not firing Events

Discussion in 'ASP .Net Web Controls' started by ESmith, Oct 19, 2005.

  1. ESmith

    ESmith Guest

    I have a table which (among other controls) contains a dropdownlist - I
    populate it as:

    private void Page_Load(object sender, System.EventArgs e)

    {

    if ( !Page.IsPostBack )

    {

    LoadCreditCardTypes();

    }


    }



    private void LoadCreditCardTypes()

    {

    CreditCardType cct = new CreditCardType();

    dt = cct.SelectAll();



    ddl_CreditCardType.DataSource = dt;

    ddl_CreditCardType.DataTextField = "CardName";

    ddl_CreditCardType.DataValueField = "CreditCardTypeID";

    ddl_CreditCardType.DataBind();

    }



    In the OnInit function I added a function "EventHookup" because I'm unable
    to

    to see any events for any controls that I add to an asp:table control.



    override protected void OnInit(EventArgs e)

    {

    EventHookup();

    InitializeComponent();

    base.OnInit(e);

    }



    private void EventHookup()

    {

    this.ddl_CreditCardType.SelectedIndexChanged += new System.EventHandler (

    this.ddl_CreditCardType_SelectedIndexChanged);

    }



    I have AutoPostBack set to TRUE, but the SelectedIndexChange never fires -
    unless I move the dropdownlist out of the table - so I assume that the table
    is "eating" the event somehow - am I suppose to propagate the event somehow?
    ESmith, Oct 19, 2005
    #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. Replies:
    5
    Views:
    713
  2. Paul L
    Replies:
    1
    Views:
    7,277
  3. SevDer
    Replies:
    2
    Views:
    1,286
    Walter Wang [MSFT]
    Nov 13, 2007
  4. Waldy

    DropDownList events not firing

    Waldy, May 7, 2008, in forum: ASP .Net
    Replies:
    4
    Views:
    435
    Waldy
    May 7, 2008
  5. TS
    Replies:
    5
    Views:
    852
Loading...

Share This Page