实现过程,只是为DropDownList控件写OnDataBound事务
protected void ddlCompany_DataBound(object sender, EventArgs e) { DropDownList ddl = (DropDownList)sender; for (int i = 0; i < ddl.Items.Count; i++) { ddl.Items[i].Attributes.Add("title", ddl.Items[i].Text); } }
实现过程,只是为DropDownList控件写OnDataBound事务
protected void ddlCompany_DataBound(object sender, EventArgs e) { DropDownList ddl = (DropDownList)sender; for (int i = 0; i < ddl.Items.Count; i++) { ddl.Items[i].Attributes.Add("title", ddl.Items[i].Text); } }
转载于:https://www.cnblogs.com/IT-Bear/archive/2012/06/27/2565455.html