前面用的方法是通过界面上操作,根据自定义模版,创建的列表。sharepoint 2010 使用自定义列表模版创建列表(1)

这里顺便记录多另一种方法,通过程序来创建。

----------------------------------------------------------------------------------------------------------------------------------

private void CreateListByCustomTemplate()

{

SPSite site = new SPSite("http://Win2012Moss");

SPWeb web = site.OpenWeb();

//指定要创建的自定义模板

string TemplateName = "CommunityTemplate.stp";

SPListTemplate CustomTemplate = null;

SPListTemplateCollection ListTemplateCollection = web.Site.GetCustomListTemplates(web);

foreach (SPListTemplate template in ListTemplateCollection)

{

if (template.InternalName == TemplateName)

{

CustomTemplate = template;

break;

}

}

web.AllowUnsafeUpdates = true;

string ListName = "ListName";

Guid guidDiscussionBoard = web.Lists.Add(ListName, "", CustomTemplate);

web.Update();

web.Dispose();

}

------------------------------------------------------------------------------------------------------------------------------

sharepoint 2010 使用自定义列表模版创建列表(2)的更多相关文章

  1. SharePoint 2010 使用自定义aspx页面替换列表默认的新建(NewForm.aspx),查看(DispForm.aspx)和编辑(EditForm.aspx)页面

    转:http://www.cnblogs.com/sygwin/archive/2011/11/04/2236678.html 如何使用自定义的aspx页(比如Application Page)替换列 ...

  2. sharepoint 2010 使用自定义列表模版创建列表(1)

    我们在使用sharepoint的过程中,发现一个比较好用的功能,就是“将此列表另存为模版”(save list as template),这个功能的作用是,创建一个和当前列表或者文档库一模一样的配置, ...

  3. sharepoint 2010 在自定义列表的字段上增加功能菜单

    sharepoint 2010 在自定义列表的字段上增加功能菜单方法 打开sharepoint designer 2010,找到需要修改的视图页面,例如allitem.aspx,编辑这个页面,点击高级 ...

  4. SharePoint 2010/2013 隐藏的速度下拉菜单列表项

    SharePoint 2010/2013 隐藏的速度下拉菜单列表项         有时为了防止一些用户编辑列表项.需要隐藏下拉菜单列表项.,仅仅须要添加一个内容编辑器控件,将css代码写入其HTML ...

  5. 根据权限显示隐藏SharePoint 2010快速启动栏的链接

    转:http://www.360sps.com/Item/ShowAndHiddenLink.aspx 在SharePoint 2010的快速启动栏中可以根据权限来显示或隐藏列表.库.网站的链接,如果 ...

  6. SharePoint 2010在win7 x64 安装

    转:http://kaneboy.blog.51cto.com/1308893/328000 关于<SharePoint 2010应用程序开发指南>,我和杜伟同学正在撰写中,希望下半年早点 ...

  7. [SharePoint 2010]关于基于声明(Claims)的用户认证模式

    转:http://blog.csdn.net/zw_2011/article/details/7417132 SharePoint 2010在用户认证模式上,较之以前的版本有了非常大的改变.在Shar ...

  8. sharepoint 2010自定义访问日志列表设置移动终端否和客户端访问系统等计算列的公式

    上个月本人开发和上线了一个在SharePoint 2010上基于HTML5的移动OA网站,后端服务采用自定义的基于AgilePoint工作流引擎的Sharepoint Web服务,前端主要采用Jque ...

  9. SharePoint 2010 BCS - 简单实例(二)外部列表创建

    博客地址 http://blog.csdn.net/foxdave 接上篇 由于图片稍多篇幅过长影响阅读,所以分段来写. 添加完数据源之后,我们需要为我们要放到SharePoint上的数据表定义操作, ...

随机推荐

  1. 获取nginx ip地理信息

    filter { grok { match => { "message" => "%{IPORHOST:clientip} \[%{HTTPDATE:time ...

  2. 转:Dynamic Binding Of RDLC To ReportViewer

    Introduction I was struggling to find the solution to bind rdlc dynamically to reportviewer .We had ...

  3. 【转】内核编译时, 到底用make clean, make mrproper还是make distclean(转载)

    原文网址:http://dongyulong.blog.51cto.com/1451604/449470 内核编译时, 到底用make clean, make mrproper还是make distc ...

  4. UESTC_树上的距离 2015 UESTC Training for Graph Theory<Problem E>

    E - 树上的距离 Time Limit: 2000/1000MS (Java/Others)     Memory Limit: 262143/262143KB (Java/Others) Subm ...

  5. xen vhd操作工具source code研读

    推出最新的VHD操作工具VHD-UTIL 实现源码,超强,Ruiy只为学习高手的设计思路

  6. WebBot - Build Web Apps as Easily as Native Ones - Home

    Python-based Template Packages Python-based Template Packages WebBot - Build Web Apps as Easily as N ...

  7. PHP MySQL Where 子句 之Where

    WHERE 子句 如需选取匹配指定条件的数据,请向 SELECT 语句添加 WHERE 子句. 语法 SELECT column FROM table WHERE column operator va ...

  8. hdu 5491 The Next(暴力枚举)

    Problem Description Let L denote the number of 1s in integer D’s binary representation. Given two in ...

  9. Tomcat部署项目的几种常见方式

    以前学习的时候只知道在Eclipse或者MyEclipse中发布项目到Tomcat,最近实习时发现不同的项目还有不同的发布方式,所以特地学习了Tomcat发布项目的方式,在此记录下来. 1 直接将we ...

  10. Visual Studio常用的快捷键

      每次在网上搜关于VS有哪些常用快捷键的时候,出来的永远是一串长的不能再长的列表,完全没体现出“常用”二字,每次看完前面几个就看不下去了,相信大家都 有这种感觉.其实我们平时用的真的只有很少的一部分 ...