Previous: Scroll Control
Next: A good week despite everything going wrong

SharePoint Webpart Communication – The Missing Link

I’ve been trying to create two webparts that communicate with each other in SharePoint. Looking around the web there are a number of good examples of how to create an asp.net 2.0 webpart that communicates with another but there are a couple of things that they don’t tell you.

Develop your webparts in one project

If you want your webparts to be able to talk to each other, you have to develop them in the same project in Visual Studio, otherwise they won’t compile. Sounds obvious enough but no-one ever actually says to do this.

Once you’ve built the provider webpart, simply add a new webpart into the solution explorer and off you go.

Linking the webparts

Another thing that is never covered for SharePoint is how to link the webparts once they’ve been developed. Firstly, click edit page, and then click the edit button on either the provider or the consumer webpart.

Screenshot of sharepoints communication options

From here you will see connections, select send ... to, or get ... from, depending on which webpart you’re looking at. Once this relationship has been established, your webparts should communicate perfectly.

Comments

  • WebPart Connections, posted by JasonHere's a step-by-step on how to connect webparts using visual studio: http://sharepointlessons.blogspot.com/2009/04/webpart-connections.html

Add a comment

1 comments

Latest Tweets

  • @sonnytoiparker http://twitpic.com/2kkard - Which one's Tommy's?

  • @nineplanfailed Sounds like my lunch

  • @nicfranc Have you seen the Epic Citadel demo on iPhone / iPad? oooooooh shiny

  • @LisaMedcalf Dunno what's happening with the house until next week, wankers essentially want me to put a new roof on!

  • @LisaMedcalf Aww cool! I saw a girl on a moped who looked a bit like you and I thought a scooter would be a good idea. Cool, cheap, fun ...

Follow Me