sharepoint 2010 使用自定义列表模版创建列表(2)
前面用的方法是通过界面上操作,根据自定义模版,创建的列表。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)的更多相关文章
- SharePoint 2010 使用自定义aspx页面替换列表默认的新建(NewForm.aspx),查看(DispForm.aspx)和编辑(EditForm.aspx)页面
转:http://www.cnblogs.com/sygwin/archive/2011/11/04/2236678.html 如何使用自定义的aspx页(比如Application Page)替换列 ...
- sharepoint 2010 使用自定义列表模版创建列表(1)
我们在使用sharepoint的过程中,发现一个比较好用的功能,就是“将此列表另存为模版”(save list as template),这个功能的作用是,创建一个和当前列表或者文档库一模一样的配置, ...
- sharepoint 2010 在自定义列表的字段上增加功能菜单
sharepoint 2010 在自定义列表的字段上增加功能菜单方法 打开sharepoint designer 2010,找到需要修改的视图页面,例如allitem.aspx,编辑这个页面,点击高级 ...
- SharePoint 2010/2013 隐藏的速度下拉菜单列表项
SharePoint 2010/2013 隐藏的速度下拉菜单列表项 有时为了防止一些用户编辑列表项.需要隐藏下拉菜单列表项.,仅仅须要添加一个内容编辑器控件,将css代码写入其HTML ...
- 根据权限显示隐藏SharePoint 2010快速启动栏的链接
转:http://www.360sps.com/Item/ShowAndHiddenLink.aspx 在SharePoint 2010的快速启动栏中可以根据权限来显示或隐藏列表.库.网站的链接,如果 ...
- SharePoint 2010在win7 x64 安装
转:http://kaneboy.blog.51cto.com/1308893/328000 关于<SharePoint 2010应用程序开发指南>,我和杜伟同学正在撰写中,希望下半年早点 ...
- [SharePoint 2010]关于基于声明(Claims)的用户认证模式
转:http://blog.csdn.net/zw_2011/article/details/7417132 SharePoint 2010在用户认证模式上,较之以前的版本有了非常大的改变.在Shar ...
- sharepoint 2010自定义访问日志列表设置移动终端否和客户端访问系统等计算列的公式
上个月本人开发和上线了一个在SharePoint 2010上基于HTML5的移动OA网站,后端服务采用自定义的基于AgilePoint工作流引擎的Sharepoint Web服务,前端主要采用Jque ...
- SharePoint 2010 BCS - 简单实例(二)外部列表创建
博客地址 http://blog.csdn.net/foxdave 接上篇 由于图片稍多篇幅过长影响阅读,所以分段来写. 添加完数据源之后,我们需要为我们要放到SharePoint上的数据表定义操作, ...
随机推荐
- UESTC_Sea Base Exploration CDOJ 409
When the scientists explore the sea base, they use a kind of auto mobile robot, which has the missio ...
- Windows多线程同步系列之二-----关键区
关键区对象为:CRITICAL_SECTION 当某个线程进入关键区之后,其他线程将阻塞等待,知道该线程释放关键区的拥有权. 关键区同步主要有以下几个API 初始化关键区对象,无返回值,传入一个关键区 ...
- POJ1270 Following Orders (拓扑排序)
Following Orders Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 4254 Accepted: 1709 ...
- ubuntu centos debina
文章目录CentOSDebianCentOS与Debian哪个好?Ubuntu买VPS时有CentOS.Debian.Ubuntu三种操作系统可以选择,Linux下哪种系统更好是很多新人都会遇到的问题 ...
- Java根据年份算出所属的生肖。
一个小程序~ public String getYear(Integer year){ if(year<1900){ return "未知"; } Integer start ...
- PHP MySQL Insert Into 之 Insert
向数据库表插入数据 INSERT INTO 语句用于向数据库表添加新记录. 语法 INSERT INTO table_name VALUES (value1, value2,....) 您还可以规定希 ...
- CTSC1999补丁VS错误题解
题目描写叙述 Description 错误就是人们所说的Bug.用户在使用软件时总是希望其错误越少越好.最好是没有错误的.可是推出一个没有错误的软件差点儿不可能,所以非常多软件公司都在疯狂地发放补丁( ...
- jsp页面使用jstl标签格式化String类型日期
1.引入jstl <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> ...
- js IP 正则表达式
//^((25[0-5]|2[0-4]\d|[01]?\d\d?)($|(?!\.$)\.)){4}$//((?:(?:25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))\ ...
- Email Cover Letter Format
http://jobsearch.about.com/od/sampleletters/ig/Sample-Letter-Formats/Email-Message-Format.htm Copy ...