摘要:
http://blog.the-dargans.co.uk/2007/04/programmatically-adding-items-to.htmlhttp://asadewa.wordpress.com/2007/11/19/adding-a-custom-content-type-specific-item-on-a-sharepoint-list/Short walk through:Get a instance of the list you want to add the item to.Add a new item to the list:SPListItem newItem = 阅读全文
摘要:
SPContentTypeId id =newSPContentTypeId(BaseContentTypeId);IList<SPContentType>ContentTypes= web.ContentTypes.Cast<SPContentType>().Where(c => c.Id.IsChildOf(id)).ToList();using(SPSite site =newSPSite(SPContext.Current.Site.Url)){ using(SPWeb web = site.OpenWeb()) { SPContentTypeCollec 阅读全文