Pass data to asp.net 2.0 web part?
I've posted this in the asp.net forum but without any response. I have a
aspx page that I want to pass data into dynamically created
webparts. Each web part will contain a user control I created
(WebUserControl1) that exposes a public property (.TestData). This property
then sets a label control on Web Part's user control....
WebUserControl1 mycontrol =
mycontrol .TestData= "test data passed to webpart's usercontrol from .aspx";
mycontrol .ID = "control";
WebPart myWebPart = WebPartManager1.CreateWebPart(mycontrol);
myWebPart.Title = "Some Title";
WebPartManager1.AddWebPart(myWebPart, WebPartManager1.Zones, 0);
But when the page renders, the webpart is created in the zone, with the
title and user control, but the data passed seems to get lost and is never
setting the label inside.
What am I doing wrong? Thanks, Dave.
|All times are GMT. The time now is 12:49 PM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.