Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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.

share|improve this answer
    
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 Oct 28 '11 at 6:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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