zoukankan      html  css  js  c++  java
  • MOSS为下拉列表绑定数据

          /// <summary>
            ///     为DropDownList帮定数据
            /// </summary>
            /// <param name="select"> 需要绑定的控件 </param>
            /// <param name="listPathLast"> 列表地址,如:Lists/Type/AllItems.aspx </param>
            /// <param name="webUrl"> web网站地址,如http://demo1/,为动态获取 </param>
            public void SelectBindData(DropDownList select, string listPathLast, string webUrl)
            {
                SPSecurity.RunWithElevatedPrivileges(delegate
                {
                    using (var site = new SPSite(webUrl))
                    {
                        using (SPWeb web = site.OpenWeb())
                        {
                            SPList projectTypeList = web.GetList(webUrl + listPathLast);
                            foreach (SPListItem s in projectTypeList.Items)
                            {
                                var ltCu = new ListItem {Value = s.Name, Text = s.Name};
                                select.Items.Add(ltCu);
                            }
                        }
                    }
                });
            }
            SelectBindData(Type, "Lists/ProjectType/AllItems.aspx" , Weburl);
  • 相关阅读:
    Spring Boot入门
    Spring MVC文件上传和下载
    Spring MVC异常处理
    SpringMVC
    linux(2)
    linux(1)
    白盒测试
    LoadRunner(8)
    LoadRunner(7)
    LoadRunner(6)
  • 原文地址:https://www.cnblogs.com/yixiaozi/p/3844270.html
Copyright © 2011-2022 走看看