Search code examples
c#asp.net-3.5web-parts

How do you disable adding the same webpart multiple times from an asp:catalogzone?


If have a standard aspx page (non-sharepoint) that hosts webparts
It contains one asp:catalogzone and four asp:WebPartZone's.

I have a business requirement that my new webpart must start in the catalog and a user can choose whether to add it to a zone to display it, (not displayed by default).

Easy so I add it to the catalog zone instaed of the webpart zone.

Problem: The user can add the same webpart multiple times and it looks really bad.

Oddly the default behavior for a webpart when it is originally hosted in an asp:WebPartZone is that it only appears in the catalog zone when it has been closed, and then it can only be added back to a webpart zone once, I want the same behavior but I want my webpart to start in the catalog.

Sounds easy.


Solution

  • you have to create a custom catalog for filtering the existing webparts like in this example: Link