3

I have deployed the code in http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webpartpages.communication.ifilterprovider.aspx. When I connect this webpart to a list webpart, for some reason in the next function, connectedPart is null. Why this is happening?

        public override void PartCommunicationConnect(
            string interfaceName,
            WebPart connectedPart,
            string connectedInterfaceName,
            ConnectionRunAt runAt)
        {
            // Keep track of whether the Web Part is connected.
            if (interfaceName == "MyFilterProviderInterface")
            {
                _connected = true;
               _connectedWebPartTitle = SPEncode.HtmlEncode(connectedPart.Title);
            }
        }

And if IFilterProvider Interface is obsolete which one should I use? Is there some example like this one?

1 Answer 1

2

If the Web Part that is being connected to is on another page, connectedPart is null.

You can use IWebPartParameters Interface and it is clearly mentioned on IFilterProvider Interface

[ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartParameters instead")] public interface IFilterProvider

Here is a sample which using IWebPartParameters Interface to build a consumer web part.

1
  • The other Web Part is not in another Page, so I don't know why it is happening this. Thanks for the link about IFilterProvider Interface. It is not what I was expecting but I could have another use for this.
    – Bargant
    Commented Oct 28, 2011 at 6:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.