Dropdown SelectedIndexChanged上的Fire Datalist ItemDataBound事件

时间:2013-10-28 10:33:22

标签: c# datalist



是否有可能在Dropdown SelectedIndexChanged上触发Datalist OnItemDataBound事件?
我正在尝试通过以下代码,但它什么都不做:

protected void drpTopic_SelectedIndexChanged(object sender, EventArgs e)
{
        dlSubjects.ItemDataBound +=new DataListItemEventHandler(dlSubjects_ItemDataBound);
}

protected void dlSubjects_ItemDataBound(object sender, DataListItemEventArgs e)
{
       // Some Code...
}

请帮我解决问题......

1 个答案:

答案 0 :(得分:0)

SelectedIndexChange重新绑定您的datalist,因为它会自动触发ItemDataBound事件