//获取属性 ProductPropertyDataSet propertyList = ProductProperty.SelectProductPropertyData(); foreach (var item in propertyList.DataList) { cblProperty.Items.Add(new ListItem(item.PropertyName, item.PropertyId.ToString())); } int id = int.Parse(Request.QueryString["id"].ToString()); DataTable dt = ProductCategory.SelectCategoryRelationPropertyDataByCategoryId(id); for (int i=0;i<cblProperty.Items.Count;i++) { for (int j = 0; j < dt.Rows.Count; j++) { if (cblProperty.Items[i].Value == dt.Rows[j]["propertyId"].ToString()) { cblProperty.Items[i].Selected = true; } } }