我用ListView的InsertItemTemplate插入数据,
我的InsertItemTemplate中使用了DropDownList控件,而DropDownList必需要通过相关的表内容进行填充,
我在ListView的 ItemDataBound 事件中,
想通过DropDownList DropDownList1 = (DropDownList)e.Item.FindControl("DropDownList1") 来获取这个DropDownList1 ,但是获取不到此控件。
然后我用DropDownList DropDownList1 = (DropDownList)ListView1.InsertItem.FindControl("DropDownList1")直接报错,
但是DropDownList DropDownList1 = (DropDownList)ListView1.InsertItem.FindControl("DropDownList1")能在ListView的ItemCommand事件中使用。
我只想在 InsertItemTemplate 中使用 能填充数据的DropDownList控件;