Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How do I add a dynamic conection to a dynamic Webpart on the same event.

Reply
Thread Tools

How do I add a dynamic conection to a dynamic Webpart on the same event.

 
 
arthernan
Guest
Posts: n/a
 
      03-10-2006
If I separate the code into two buttons on a web page it works. One
button creates the webpart and the second creates the connection. But
the minute I move the connection creation code to the web part
creation, I get a webpart does not belong to this page.

I can appreciate how the webparts may not be ready for the connections.
How do I make them ready on the same event? I don't want to have users
clicking two buttons to open two connected webparts.

The following are the separated procedures that do work:


Protected Sub CreateWebParts_Click(ByVal sender As Object, _
ByVal e As System.EventArgs)
Handles CreateWebParts.Click
Dim _PersonListPart As New myControls.PersonListPart
Dim _PersonSearchPart As New myControls.PersonSearchPart
WebPartManager1.AddWebPart(_PersonSearchPart, Me.WebPartZone2,
0)
WebPartManager1.AddWebPart(_PersonListPart, Me.WebPartZone2, 0)
End Sub


Protected Sub ConnectWebParts_Click(ByVal sender As Object, _
ByVal e As System.EventArgs)
Handles ConnectWebParts.Click
Dim _PersonSearchPart As MyControls.PersonSearchPart = _

WebPartManager1.WebParts(0)
Dim _PersonListPart As myControls.PersonListPart = _

WebPartManager1.WebParts(1)
Dim provPoint As ProviderConnectionPoint = _

WebPartManager1.GetProviderConnectionPoints(_Perso nSearchPart)(0)

Dim consPoint As ConsumerConnectionPoint = _

WebPartManager1.GetConsumerConnectionPoints(_Perso nListPart)(0)
WebPartManager1.ConnectWebParts(_PersonSearchPart, provPoint, _

_PersonListPart, consPoint)

End Sub

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
.NET 1.1 WebPart to .NET 2.0 WebPart anars ASP .Net 0 01-07-2007 07:31 PM
add a new webpart zone Justin Kadima ASP .Net 0 10-10-2006 11:26 AM
New Conection problem yar Wireless Networking 2 03-23-2005 01:30 AM
I can access a laptop from a desktop using a wireless conection =?Utf-8?B?dG9tYmNhdDE0MjAwMA==?= Wireless Networking 1 11-29-2004 02:51 AM
bluetooth conection from phone to PC =?Utf-8?B?TS5TLkdpbGw=?= Wireless Networking 2 11-22-2004 01:05 PM



Advertisments