07 2013 档案
摘要:using System;using System.Collections.Generic;using System.Text;using Microsoft.SharePoint;using System.Web;namespace MyProject.Features{ public class MyEventReceiver : SPItemEventReceiver { HttpContext currentContext; public MyEventReceiver() { currentContext =...
阅读全文
摘要:protected void CreateDocLib(){SPSite site = SPContext.Current.Site;SPWeb web = site.OpenWeb(); SPListTemplateType templateType = SPListTemplateType.DocumentLibrary;Guid listId = web.Lists.Add("MyDocLibrary", null, templateType);SPList list = web.Lists[listId]; // create Text type new colum
阅读全文
摘要:static void Main(string[] args) { string newPageUrl = ""; SPSecurity.RunWithElevatedPrivileges(delegate()// executing this code with elevated privileges will help whenever we create the publishing pages from a sharepoint portal site for an another portal site.If we create the publishing pa
阅读全文
摘要:在VS中创建一个applicationPage映射到Layouts文件夹下,然后代码如下:SPList lstTest = web.Lists["Shared Documents"];string newUrl = string.Format("layouts/NewEditForm.aspx", web.ServerRelativeUrl, lstTest.RootFolder.Url);var form = web.GetFile(newUrl);if (form != null && form.Exists){ //string n
阅读全文

浙公网安备 33010602011771号