DropDownList Control within table not firing Events

E

ESmith

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,709
Latest member
AustinMudi

Latest Threads

Top