protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e) { DataList dtl2 = (DataList)e.Item.FindControl("DataList2"); int cateId; int.TryParse(DataBinder.Eval(e.Item.DataItem, "CateNewsID").ToString(), out cateId); // int cateId = ((int)e.Item).CateNewsID; string strCate = GetCateParentIDArrayByID(cateId, Convert.ToInt32(hddGroupCate.Value)); NewsGroupBSO newsGroupBSO = new NewsGroupBSO(); DataTable table = newsGroupBSO.GetNewsGroupByCateHomeList(strCate, 5, "1", Convert.ToInt32(hddGroupCate.Value)); DataView view = new DataView(table); view.Sort = "PostDate Desc"; table = view.ToTable(); dtl2.DataSource = table; dtl2.DataBind(); }