SmartPart :: Webpart connections not working

Aug 31, 2009 at 11:46 AM

Hi all, 

I’m trying to set up a web part connection between a Query string filter web part and a SmartPart.
I’m using the code below to connect the web parts from code to allow automatic deployments.

SPLimitedWebPartManager webPartManager = this.web.GetLimitedWebPartManager(pageUrl, PersonalizationScope.Shared);


System.Web.UI.WebControls.WebParts.WebPart provider = webPartManager.WebParts[providerWebPartIndex];
System.Web.UI.WebControls.WebParts.WebPart consumer = webPartManager.WebParts[consumerWebPartIndex];

ProviderConnectionPointCollection providerCollections = webPartManager.GetProviderConnectionPoints(provider);
ConsumerConnectionPointCollection consumerConnections = webPartManager.GetConsumerConnectionPoints(consumer);

 SPWebPartConnection connection = webPartManager.SPConnectWebParts(







When I’m running this code the consumerConnections.Count remains 0 and no connection can be created.
The weird thing though is that setting up a connection manually from within SharePoint works like a charm. It seems like the SmartPart only exposes its connections when rendered or something?

Any thoughts / experiences on this?

Kind regards,