为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