473,320 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

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

Mar 10 '06 #1
0 1065

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Greg Merideth | last post by:
This is mainly a sharepoint webpart development issue but after 4 days of posting I haven't had even one answer so I figured I'd post here and see if anyone might spot something. There might be...
0
by: J. Jespersen | last post by:
Hi people, I fiddling with webparts, and have created my own custom webpart from scratch. The webpart itself is contained in a myPart.dll I have two different sites. SiteA and SiteB. Both are...
0
by: Daniel Doyle | last post by:
Hello and apologies in advance for the amount of code in this post. I've also sent this message to the Sharepoint group, but thought that ASP.NET developers may also be able to help, even though...
0
by: news.microsoft.com | last post by:
I am having some trouble with my webpart connections on postbacks. I basically have two webparts in the same zone, 1 provider and 1 consumer. The provider has a dropdown list and submit button...
1
by: Michael | last post by:
Hi, Is there a way to write some code to do some stuffs after a WebPart has been closed? I want to store the state of the WebPart in the user's profile so that I can determine if a particular...
1
by: Shell | last post by:
Hi All, I have a scenario where I have a Master Page for all of my WebPages, and in one of the pages I update a database record, after that I want to refresh this WebPart on Master Page...
5
by: Paal Berggreen | last post by:
I am involved with development of a Portal solution using ASP.NET 2.0 and WebParts. The WebParts framework use the default personalization providers, and the personalization data thus ends up in...
3
by: Jav | last post by:
I create a UserControl (.ascx), and then change it in code to: Inherits System.Web.UI.WebControls.WebParts.WebPart expecting that it will now be treated as a WebPart. But this immediately...
1
by: chandhrakv | last post by:
Hi experts, Can any one please respond with the resolution. Machine: WIN2K3, ASP.NET application, .NET 2.0 with June 2007 hotfix installed recently. Facing daily 1000 errors with the same type...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.