How do I programmatically move a web part from one zone to another on a page? I have multiple sites that I want to loop through each site and update the page.
Tell me more
×
SharePoint Stack Exchange is a question and answer site for
SharePoint enthusiasts. It's 100% free, no registration required.
|
Use the SPLimitedWebPartManager.MoveWebPart method:
|
|||||
|
|
In addition to the answer from Alex, be careful when you iterate your site collections and sites. If you do this from for example a console application where you have to establish your own context, you will run out of memory very fast if you forget to dispose your SPSite and SPWeb objects while iterating (eg. sites.AllWebs). read and understand the disposing guidelines on MSDN: http://msdn.microsoft.com/en-us/library/aa973248.aspx |
|||
|
|