public void GetSiteColumns(DropDownList ddl, String siteColumn)
{
var fields = new SPSite(ProjectContent.SiteUrlMapping).RootWeb.Fields;
var projectCodeXml = fields.TryGetFieldByStaticName(siteColumn).SchemaXml;
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(projectCodeXml);
XmlNode xn = xmlDoc.SelectSingleNode("Field/CHOICES");
foreach (var xnl in xn)
{
XmlElement xe = (XmlElement)xnl;
ddl.Items.Add(xe.InnerText);
}
}
05-11 17:55