Answered Cannot add web parts to pages located in _layouts folder

  • Wednesday, July 01, 2009 6:30 AM
     
     
    I am developing a website in SharePoint 2007 where all the .aspx pages are located in a subdirectory within the _layouts directory in the 12 hive.
    I have designed a custom masterpage with corporate branding and I am using this masterpage in the .aspx pages.
    I have found that I cannot add web parts(both in-built and custom) to these .aspx pages.
    I get the error: "Unable to add the selected web part(s). The security validation for
    this page is invalid."
    Is it that we cannot add web parts to .aspx pages that reside within the _layouts directory of the SharePoint's 12 hive?
    Please help.Thanks in advance.
    • Moved by Mike Walsh FIN Wednesday, July 01, 2009 12:16 PM cust q (From:SharePoint - Development and Programming)
    •  

All Replies

  • Wednesday, July 01, 2009 11:11 AM
     
     
    I dont think you can add webparts to application pages (pages which exist in the _layouts directory), these are just ASPX pages.  WebPart pages or Pages created using a Page Layout need to exist in a list to support hosting webparts by the webpart manager.
    My SharePoint Blog - http://www.davehunter.co.uk/blog
  • Wednesday, July 01, 2009 12:15 PM
     
     

    Questions on master page are customization not programming.

    Moving to the customization forum.


    WSS FAQ sites: http://wssv2faq.mindsharp.com and http://wssv3faq.mindsharp.com
    Total list of WSS 3.0 / MOSS 2007 Books (including foreign language) http://wssv3faq.mindsharp.com/Lists/v3%20WSS%20FAQ/V%20Books.aspx
  • Thursday, July 02, 2009 8:17 AM
     
     
    Dave, actually you can add web parts to application pages,we call that "static web parts", they behave like  normal controls; if you add web parts into web part zones in web part pages, we call them "dynamic web parts" (can be added and dropped at runtime).

    You can add web parts in master pages, but not in web part zone

    Serge Luca

    Serge Luca; blog: http://www.redwood.be
  • Thursday, July 02, 2009 8:51 AM
     
     Answered
    Yeah I've used this before, they run like web server controls.  The error message above looks like the user has added a webpart zone and tried to add a webpart in an application page.
    My SharePoint Blog - http://www.davehunter.co.uk/blog