Description

SharePoint supports a custom implementation of WebPartManager named SPWebPartManager. In addition, there is an SPLimitedWebPartManager class that supports environments that have no HttpContext or Page available.

Resolution

If you have HttpContext then use SPWebPartManager. When no HttpContext (in event receivers for example) is available you should use SPLimitedWebPartManager. It only supports a subset of features available in SPWebPartManager.

Links