CatalogZone.CreateCatalogParts Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates an instance of each CatalogPart type that is declared in the zone.
protected:
override System::Web::UI::WebControls::WebParts::CatalogPartCollection ^ CreateCatalogParts();
protected override System.Web.UI.WebControls.WebParts.CatalogPartCollection CreateCatalogParts ();
override this.CreateCatalogParts : unit -> System.Web.UI.WebControls.WebParts.CatalogPartCollection
Protected Overrides Function CreateCatalogParts () As CatalogPartCollection
Returns
A CatalogPartCollection with references to all the CatalogPart controls in the zone.
Exceptions
The current CatalogPart control does not have an ID.
Remarks
The CreateCatalogParts method is a critical method because when a user switches a page to catalog display mode, this method creates all the CatalogPart controls that make up the Web Parts catalog.
The CreateCatalogParts method in the CatalogZone class provided with the Web Parts control set can create any server control that inherits from the CatalogPart class. So, if you create a custom CatalogPart control and declare it on a page within a CatalogZone control, this method will create your control when a user switches the page to catalog mode.
However, for various reasons you might want control over the CreateCatalogParts method. You might want it to create only certain CatalogPart controls. For example, suppose you create a set of custom CatalogPart controls that have a consistent appearance and belong to a single product or organization. If you want page developers to be limited to using those custom controls in a catalog, then you should inherit from the CatalogZone class, override the CreateCatalogParts method, and allow the method to create only controls of the same type as your custom controls.
Applies to
See also
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈