SharePoint - Passing parameters from one webpart to another
Asked By Thomas
19-Aug-07 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
SPGridView
(1)
ASP.NET
(1)
CreateChildrernControls
(1)
ObjectDataSource
(1)
WebPartManager
(1)
ConnectionProvider
(1)
ConnectionConsumer
(1)
ConnexionConsumer
(1)
humbleapprentic replied...

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
Thomas replied...
Thanks a lot for your help :) It was very usefull
Cheers,
Thomas
integration asp.net with sharepoint server 2007 possibilities SharePoint I'm new to both asp.net development and sharepoint 2007. I was wondering if it was possible to design an asp.net application first as a standalone web application and later integrate it with sharepoint when funds PageViewer (1) Kothawade (1) Directory (1) Infopath (1) Rupali (1) SharePoint requires good understanding of asp.net To answer your question, yes it is possible to design an asp.net application then
Single Sign On to ASP.NET application SharePoint I’m recently assigned to create a link on our sharepoint site which opens up an ASP.NET 2.0 web application. Both our Sharepoint site and the ASP.NET 2.0 website use forms Authentication with membership provider. Both of them work perfectly independently But I have a problem in implementing the single sign on idea on the ASP.NET 2.0 web site(launched from sharepoint site). To make myself clear, once the user
Howto publish an ASP.NET website to MOSS 2007? SharePoint Hello, being a newbie to C# / ASP.NET / MOSS 2007 I'm struggling with publishing either a Web Project or Website (both ASP.NET 2.0) to our company intranet on MOSS 2007. 1) The Web Project is created ascx-webusercontrols and webparts. It actually works as "standalone" website, which is tested locally on ASP.NET Local Development Server (Vista Business) and doesn't make use of any specific MOSS 2007
Access Sharepoint using ASP.NET 1.1 SharePoint I've to access sharepoint portal server from ASP.NET 1.1 and specifically I've to upload files from ASP.NET 1.1 to Sharepoint server. Can somebody help me to find out how? - - Thanks, Deepak Technical Manager WNS NA Inc., NA deepak.vij@firstmagnus.com SharePoint Portal Server Dev Discussions ASP.NET (1) SharePoint (1) - -- -- - = _NextPart_0001_A346A9A4 Content-Type: text / plain Content-Transfer-Encoding: 7bit Hello Deepak, I