- SPWeb web= properties.Web;
- //Folder123 is Inside root location of List
- string DestinationFolderName="Folder123";
- // Source item outside folder Folder123
- SPListItem listitem = properties.ListItem;
- SPFile listitemFile = web.GetFile(listitem.Url);
- //Create New Destination URL ../Lists/Folder123/1_.000
- string NewDestinationUrl=listitemFile.Url.Replace(listitem.ID.ToString()+"_.000",DestinationFolderName+"/"+listitem.ID.ToString()+"_.000");
- //Move Item Insite Folder123
- listitemFile.MoveTo(NewDestinationUrl);
Thursday, 4 October 2012
Move listitems programatically to sub folder in sharepoint 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment