search
Japanese Chinese Nederlands Espanol Italiano Deutsch Francais Twitter Rss Feeds
SharePoint GroupsView
Sharepoint Design_And_Customization
Sharepoint Development_And_Programming
Sharepoint General
Sharepoint Portalserver
Sharepoint Portalserver Development
Sharepoint Setup_And_Administration
Sharepoint Windowsservices
Sharepoint Windowsservices Development

Group SummariesView
.NET Framework
Access
BizTalk
Certifications
CRM
DDK
Exchange Server
FoxPro
French
French .NET
Games
German
German .NET
Graphic Design
IIS
Internet
ISA Server
Italian
Italian .NET
Maps
MCIS
Miscellaneous
Mobile Application Development
Money
MSN
Networking
Office
Ops Mgr
Publisher
Security
SharePoint
Small Business
Spanish
Spanish .NET
SQL Server
Systems Management Server
Transaction Server
Virtual PC / Virtual Server
Visual Studio
Win32
Windows 2000
Windows 2003 Server
Windows 7
Windows Live
Windows Media
Windows Update
Windows Vista
Windows XP
 

View All Microsoft Sharepoint Development_And_Programming Posts  Ask A New Question 

Passing parameters from one webpart to another - Thomas

Sunday, August 19, 2007 10:32 AM

Hello,

I'm stuck with following problem. I have two webparts on one page. I would
like to pass parameters from one webpart to another. I used for that the
ConnexionProvider and ConnexionConsumer pattern. All works fine except one
thing.
In the second WebPart (ConnexionConsumer) the data is displayed in a
SPGridView which is bound to ObjectDataSource with SelectMethod set to the
method that retrives data from the data base. The problem is that I noticed
that SelectMethod fires only once, on the firts page render. When I select
values in the first webpart and do the postback (submit) the second webpart
receives values in connexionconsumer method but the select method didn't
fire so the old data is displayed without taking into acount the new
parameters received from the first webpart.
SpGridView is bound to ObjectDataSource in CreateChildrernControls Method. I
would like that ObjectDataSource fires select method on each pagepostback
and take into account values received from firts webpart by
connexionconsumer method. What I'm doing wrong ???

Thanks,

Thomas
reply
 

Hi Thomas,My suggestion will be to first trace where the events are happening. - humbleapprentic

Monday, August 20, 2007 6:26 AM

Hi Thomas,

My suggestion will be to first trace where the events are happening. Take
your webpart and place it in an ASP.NET portal framework page, set your break
points and test it. I found that if you want to connect web parts using the
portal framework you have to do it programmaticaly (supposedly you can do it
at run time but I still learning the portal framework). To connect them there
are a few steps to follow:

* Provide a definition for "ConnectionConsumer" and "ConnectionProvider"
* OnInit should create a handler for Page_Load (so Page.Load += new
EventHandler(Page_Load);)
* On page load create a WebPartManager.ConnectionsActivating += new
EventHandler(WebPartManager_ConnectionsActivating);

Here is a few links that could help you:

http://www.carlosag.net/Articles/WebParts/moreRealSample.aspx
http://quickstarts.asp.net/QuickStartv20/aspnet/doc/webparts/connections.aspx
http://msdn.microsoft.com/msdnmag/issues/06/02/BasicInstincts/.

You don't have to use IField if you don't want to, as long as they share a
common interface is all good. Let me know if you need more, I am working on a
similar project (and it is painful so I want to safe others the pain).

Cheers,

humble.apprentice
reply

Passing parameters from one webpart to another - Thomas

Monday, August 20, 2007 5:00 PM

Thanks a lot for your help :) It was very usefull

Cheers,

Thomas
reply
 
 

Previous Microsoft Sharepoint Development_And_Programming conversation.