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?
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?