您的位置:首页 > 运维架构

如何将sharepoint列表中choice类型的值绑定到dropdownlist上

2009-10-13 19:48 423 查看
using (SPSite site=new SPSite(siteurl))
{
using(SPWeb web=site.OpenWeb())
{
try
{
SPList list = web.Lists["ServiecesInfo"];
SPFieldChoice spcustomerlocation = new SPFieldChoice(list.Fields, "CustomerLocation");
for (int i = 0; i < spcustomerlocation.Choices.Count; i++)
{
ddlCustomLocation.Items.Add(new ListItem(spcustomerlocation.Choices[i].ToString(), i.ToString()));
}
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐