Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Webpart's talking

  Asked By: Ricardo    Date: Mar 10    Category: Sharepoint    Views: 1540

Is it possible to have a link in one webpart that brings up the page in
another webpart ?

We have a webpart with many links and we want users to click those links and
have the results in another webpart on the same dashboard.

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Alexander Scott     Answered On: Mar 10

Here is a quick/simple sample displaying how to have a link  in one web part
load the content in a second:

<!-- web part 1 -->
<html>
<body>
<table>
<tr>
<td>
<a href="javascript:
loadcontent('http://www.weather.com')">Weather</a>
</td>
</tr>
<tr>
<td>
<a href="javascript:
loadcontent('http://microsoft.com')">Microsoft</a>
</td>
</tr>
</table>
</body>

<script language="javascript">
function loadcontent(path)
{
parent.DDSC.RaiseEvent("urn:test:links","loadcontent",path);
}
</script>
</html>

<!-- web part 2 -->
<html>
<body>
<iframe id="main">
</iframe>
</body>

<script language="javascript">
DDSC.RegisterForEvent("urn:test:links","loadcontent",gopath);
function gopath(path)
{
document.all.main.src = path;
}
</script>
</html>

Now if they are external web pages you can use javascript to reference the
iframe name which is something like : "WebPartWPQ2"

 
Didn't find what you were looking for? Find more on Webpart's talking Or get search suggestion and latest updates.




Tagged: