0

i got an exception when i'm trying to initilize the SPLimitedWebPartManager from SPWeb.GetLimitedWebPartManager: i think it does not accept the files inside _layouts folder, because i'm deplying this page containg web parts inside _layouts folder.

any help please.

        using (SPLimitedWebPartManager wpm =             
                  web.GetLimitedWebPartManager(this.Page.Request.Url.AbsolutePath, 
                            PersonalizationScope.Shared))
                  {
                      foreach (System.Web.UI.WebControls.WebParts.WebPart current in   
                       wpm.WebParts)
                      {
                          if (current is XsltListViewWebPart)
                          {
                          }
                      }
                  }
0

Yes, the page would need to be GhostableInLibrary. You would not be able to add web parts to a page stored on the file system.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.