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:

  1. Get a instance of the list you want to add the item to.
  2. Add a new item to the list: SPListItem newItem = list.Items.Add();
  3. To bind you new item to a content type you have to set the content type id for the new item:newItem["ContentTypeId"] = <Id of the content type>;.
  4. Set the fields specified within your content type.
  5. Commit your changes: newItem.Update();

相关文章:

  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
  • 2021-06-09
  • 2022-12-23
  • 2022-12-23
  • 2021-05-15
猜你喜欢
  • 2022-12-23
  • 2021-07-24
  • 2022-01-15
  • 2021-10-05
  • 2022-12-23
  • 2021-09-09
  • 2021-08-07
相关资源
相似解决方案