I'm a newbie and this might be simple but am going around in circles for now. I want to get rid of the DeclarativeCatalog Part and implement my own system for adding my custom web parts to a page. I'm aware that I can use the WebPartManager object to add Web Parts, and the syntax off the WebPartManager object is:
WebPartManager.AddWebPart(WebPart, WebPartZone, ZoneIndex)
My question is how to get the "handle" to the given custom Web Part. Ex:
<%@ Register TagPrefix="psp" TagName="ButtonBar" Src="./UserControls/ButtonBar.ascx" %>
Dim
ButtonBar1 As WebPartButtonBar1 = [don't know what to put here] (I looked into using the CreateWebPart method but seems to work only as a wrapper for non-webparts).
wpm.AddWebPart(ButtonBar1, pspZone1, 0)
Would appreciate a nudge in the right direction. Also, some of the custom web parts are written as user controls (like the example above), and others are written as true web parts, so it would be great to have a solution that accomodates both approaches.
Thanks much in advance for any help....