爲DropDownList我有一個DataList,我試圖找到在datalist
的dropdown
在其文本中添加第一指數ddl
我想這樣做,但這個出現(object reference not set
.... )添加新項數據列表
這裏是我的代碼:
private DropDownList DDLProduct;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void DDlProduct_DataBound(object sender, EventArgs e)
{
DDLProduct.Items.Insert(0, new ListItem("Swithch Model", "0"));
}
protected void DLProduct_ItemDataBound(object sender, DataListItemEventArgs e)
{
DDLProduct = e.Item.FindControl("DDlProduct") as DropDownList;
}
問候
哎呀它幾乎什麼jonh說:) – naveen 2011-04-06 13:50:48