Im trying to set the SelectedIndexChanged from the code behind of a Web Forms application. I have a variable amount of dropdowns being added onto the page from the database and need a method to trigger each time one of the dropdowns change.
Im currently trying:
ddlProductCause.SelectedIndexChanged += new EventHandler(ddlProductCause_Changed);
ddlProductCause.ID = "ddlProductCause_" + row["item_id"].ToString();
ddlProductCause.AutoPostBack = true;
and...
public void ddlProductCause_Changed(object sender, CommandEventArgs e)
{
// do stuff
}
But I have no luck.
Any ideas?