Configuring SmartPart During Feature Activation

May 23, 2007 at 9:32 PM
Anyone know how to create an instance of the SmartPart and populate it with a user control during the FeatureActivated event? The following code doesn't give an error but when I browse to my page the SmartPart is in the zone but my control is not loaded. Any ideas?

  SPFile page = site.GetFile( "UserAdmin.aspx" );
  SPLimitedWebPartManager mgr = page.GetLimitedWebPartManager( PersonalizationScope.Shared );
  SmartPart.SmartPart smart = new SmartPart.SmartPart();
  smart.UserControl = "My.Assembly,My.Assembly.Users";
  mgr.AddWebPart( smart, "centerWebPartZone", 0 );
May 23, 2007 at 9:45 PM
Never mind - the code above works - it's my user control I'm loading that's the problem.