I am trying to add a webpart to aspx page webpart code is pasted below. I am able to see the content in the page, but it is not recognized as webpart.
using (SPLimitedWebPartManager wpm = file.GetLimitedWebPartManager(System.Web.UI.WebControls.WebParts.PersonalizationScope.User))
{
foreach (WebPart wp in wpm.WebParts)
}
i am getting wpm.weparts.count=0 always until i customize the page and make it as un-ghosted.
may i know what i am doing it wrong here?