I have a custom web part which does not allow multiple connection. Scenario : i add the custom web part on the page , add 2 list on the same page .
Step 1 : I connect List 1 to web part and implement my functionality.
Step 2 : I delete List1.
Step 3 : I get my custom error message that list name is invalid.[As required for the functionality]
Step 4 : I edit web part , and try to connect it to List 2.
Step 5 : Error message received "The connection point "filter parameter" on "g_789a749a_836c_45c4_b247_f4bfa28b94a3" does not allow multiple connections. "
Stack Trace
WebPartPageUserException: The connection point "filter parameter" on "g_789a749a_836c_45c4_b247_f4bfa28b94a3" does not allow multiple connections.]<br/>
Microsoft.SharePoint.WebPartPages.SPWebPartManager.CanSPConnectWebPartsCore(WebPart provider, ProviderConnectionPoint providerConnectionPoint, WebPart consumer, ConsumerConnectionPoint consumerConnectionPoint, WebPartTransformer transformer, Boolean throwOnError) +2369<br/>
Microsoft.SharePoint.WebPartPages.SPWebPartManager.SPConnectWebParts(WebPart provider, ProviderConnectionPoint providerConnectionPoint, WebPart consumer, ConsumerConnectionPoint consumerConnectionPoint, WebPartTransformer transformer, Boolean bCheck) +96<br/>
Microsoft.SharePoint.WebPartPages.Communication.PersistConnection.CreateConnection(String xFormTypeName, String xFormInfo) +630<br/>
Microsoft.SharePoint.WebPartPages.Communication.PersistConnection..ctor(ConnectionDesigner designer, SPWebPartManager manager) +1517<br/>
Microsoft.SharePoint.WebPartPages.Communication.ConnectionDesigner.PersistChangedConnections() +63<br/>
Microsoft.SharePoint.WebPartPages.SPWebPartManager.CreateConnectionDesigner() +437<br/>
Microsoft.SharePoint.WebPartPages.SPWebPartManager.ActivateConnections() +361<br/>
System.Web.UI.WebControls.WebParts.WebPartManager.OnPageLoadComplete(Object sender, EventArgs e) +70<br/>
System.EventHandler.Invoke(Object sender, EventArgs e) +0<br/>
System.Web.UI.Page.OnLoadComplete(EventArgs e) +11046222<br/>
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3160<br/>
i am think of checking weather the web part has any connection or could be connected to the list.
Can anyone help me in implementing this.