Adding web part to a CatalogZone programmatically

J

Johan

Doing some testing on ASP.NET 2.0 here...

I'm looking for a way to programmatically add web parts to a
CatalogZone. I cannot use WebPartManager.AddWebPart() method because the
CatalogZone is not based on the WebPartZoneBase class.

/Johan
 
M

Mike Harder [MSFT]

CatalogZones do not directly contain WebParts. CatalogZones contain
CatalogParts, and CatalogParts can indirectly contain WebParts, in the
sense that CatalogParts offer up WebParts that can be added to the page.

I assume that you want to dynamically add WebParts to a CatalogPart. You
can potentially do this with the DeclarativeCatalogPart by programmatically
setting the WebPartsTemplate. However, you will probably be better off
writing your own CatalogPart that does exactly what you want. Just derive
from CatalogPart and override the GetAvailableWebPartDescriptions() and
GetWebPartMethods().

--
Mike Harder, ASP.NET Team

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.


--------------------
 
J

Johan

Ah, that's what I thought. First I was going to write my own kind of
"catalog", just a simple list of available Web Parts and add them using
the WebPartManager.AddWebPart() method. But I'll look into deriving from
CatalogPart, that looks funny :)

Thanks for the tip.

/Johan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top