Handle events in SPWebPartManager

Tag: sharepoint Author: huting6677 Date: 2009-07-12

How do i handle events such as "WebPartMoving" and "WebPartMoved" in a page conataining webparts. The webpart manager tag is added to the master page. So i added the handler to code behind:

m.WebPartMoving += new System.Web.UI.WebControls.WebParts.WebPartMovingEventHandler(m_WebPartMoved);

but it's not working...what could be the reason?

Other Answer1

Could you try to create your own WebPartManager (derived from SPWebPartManager) and try to override the method in the WebPartManager itself. It seems SPWebPartManager does not raise all events. (source) Just to check it out.

Other Answer2

SPWebPartManager is sealed!!