0
votes

Greetings.

I have a bunch of ASP.NET webparts added to the WebPartsTemplate section of a DeclarativeCatalogPart. These webparts are classic ASP.NET User Controls (ascx) that implement System.Web.UI.WebControls.WebParts.IWebPart.

I discovered that the page load event is firing for all controls added to the DeclarativeCatalogPart REGARDLESS of whether or not the user has actually added the control to a visible WebPartZone.

Is there a way to only have Page Load fire in the ascx webparts when the webparts are added to a WebPartZone by a user? Converesely, how can I NOT have the Page Load event fire for all webparts declared in the DeclarativeCatalogPart?

1

1 Answers

0
votes

why don't you just check on Page_Load if the web part is visible if not then just return from Page_Load.