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);
  • 相关阅读:
    进程与线程
    the art of seo(chapter seven)
    the art of seo(chapter six)
    the art of seo(chapter five)
    the art of seo(chapter four)
    the art of seo(chapter three)
    the art of seo(chapter two)
    the art of seo(chapter one)
    Sentinel Cluster流程分析
    Sentinel Core流程分析
  • 原文地址:https://www.cnblogs.com/yixiaozi/p/3844270.html
Copyright © 2011-2022 走看看