Deploy two connected webparts in a page layout during feature activation? <p>I've implemented 2 webparts (deriving from Microsoft.SharePoint.WebPartPages.WebPart, the WSS 3 WebPart), one of which is a provider and the other the consumer (implementing ASP.net connection model, with <em>ConnectionProviderAttribute</em> and <em>ConnectionConsumerAttribute</em> methods).</p> <p>I managed to deploy them in a feature which also deploys a Page Layout containing two webpart zones, which are themselves populated during the FeatureAvtivated method of the feature receiver, with the 2 newly created webparts. All of this works just fine.</p> <p>For information, I used <a href="http://vspug.com/michael/2009/05/25/manage-webparts-of-page-layouts-through-a-feature-resolving-the-quot-alluserswebpart-quot-pain/" rel="nofollow">this link</a> to make it work. Beware, the method using <em>AllUsersWebPart</em> tag in <em>elements.xml</em>, shown in links like this one (http://www.andrewconnell.com/blog/archive/2007/10/07/Having-Default-Web-Parts-in-new-Pages-Based-Off-Page.aspx) work, but if you deactivate, then reactivate your feature, you just have double webparts in your future pages based on the layout. The method described here (http://sharepoint.coultress.com/2008/06/adding-web-part-to-page-layout.html) just threw me an error when analysing metadata for the layout aspx file (the problem seemed to come from the line in the ZoneTemplate tag).</p> <p>My next goal is to connect these webparts together right after all this, thus enabling the end user to create pages, based on the layout, containing <strong>by default</strong> the two webparts <strong>connected</strong> together (right now everything works except for the <em>connected</em> part).</p> <p>I tried something like <a href="http://vspug.com/jason/2007/06/21/how-to-connect-web-parts-programmatically-in-wss-3/" rel="nofollow">this</a>, using ASP.net connection model (the other one, WSS model, throws logically an error because I'm not implementing the good interfaces). But even though the connection resulting from the "mgr.SPConnectWebParts()" method doesn't throw any exception and actually adds the connection to the connection list of the webpart manager, I can see in debug mode that the connection property 'IsActive" is false (maybe normal), and that when I create a new page based on the layout, the webparts appear not connected.</p> <p>Any guess? I believe there's something with the fact that the webparts cannot be connected before the page containing them is actually created, but I'm far from sure of it.</p>