zoukankan      html  css  js  c++  java
  • 绑定People and Group

      private void BindOwner()
             {
                 using (SPSite site = new SPSite(siteurl))
                 {
                     using (SPWeb web = site.OpenWeb())
                     {
                         DataTable ownerTable = Make_Table();
                         foreach (SPUser user in web.SiteGroups["Owner"].Users)
                         {
                             if (user.Name != "System Account")
                             {
                                 DataRow row = ownerTable.NewRow();
                                 row["Name"] = user.Name;
                                 row["LoginName"] = user.LoginName;
                                 ownerTable.Rows.Add(row);
                             }
                         }
                         DropDownListOwner.DataSource = ownerTable;
                         DropDownListOwner.DataTextField = "Name";
                         DropDownListOwner.DataValueField = "LoginName";
                         DropDownListOwner.DataBind();
                     }
                 }
             }


             private DataTable Make_Table()
             {
                 DataTable nameTable = new DataTable("Names");
                 nameTable.Columns.Add("Name");
                 nameTable.Columns.Add("LoginName");
                
                 return nameTable;
             }

  • 相关阅读:
    File
    Include and Require
    Date and Time
    css3的nth-child选择器使用示例
    document.title
    php获取从百度搜索进入网站的关键词的详细代码
    Iphone手机、安卓手机浏览器控制默认缩放大小的方法
    离线宝调用
    织梦DedeCMS网站地图模板
    禁止选择文本和禁用右键 v3.0
  • 原文地址:https://www.cnblogs.com/KingStar/p/1594562.html
Copyright © 2011-2022 走看看