8,497
社区成员
发帖
与我相关
我的任务
分享
XElement root = XElement.Load(Server.MapPath("~/1.xml"));
var query = from f in root.Elements("CerType")
select new { TypeID = f.Element("TypeID").Value, TypeName = f.Element("TypeName").Value };
DropDownList1.DataValueField = "TypeID";
DropDownList1.DataTextField = "TypeName";
DropDownList1.DataSource = query.ToList();
DropDownList1.DataBind();