Link List That Controls Another Web Part

Occassionally folks will ask to have a list of links in one web part and have another web part display that content.  There is a stupid HTML trick you can do to pull this off.  This is one of those situations where it is nice to have required Internet Explorer.

Add two Content Editor Web Parts to the web part page.

In Web Part A add the following code:   

<iframe name=”myframe” src=”http://www.msn.com”></iframe>

In Web Part B add the following code: 

<li><a href=”http://www.microsoft.com” target=”myframe”>Microsoft</a>
<li><a href=”http://www.msn.com” target=”myframe”>MSN</a>
<li><a href=”http://msdn.microsoft.com” target=”myframe”>MSDN</a>

The net effect is that clicking a link in Web Part B causes it to display inside web part A.

If you want to get fancy, you can use a data view web part to render Web Part A from a list based on the Links list template, and modify the XSL to target the frame in Web Part B.

8 Comments

Comments have been disabled for this content.