Skip to content

Cannot create custom list after rebranding Application.master

August 30, 2011

After rebranding application.master I got this error when creating a custom list:

The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.   at Microsoft.SharePoint.Library.SPRequestInternalClass.CreateListFromFormPost(String bstrUrl, String& pbstrGuid, String& pbstrNextUrl)
at Microsoft.SharePoint.Library.SPRequest.CreateListFromFormPost(String bstrUrl, String& pbstrGuid, String& pbstrNextUrl)

To remove this error you need to make sure you have all ContentPlaceHolder needed and don’t make the same mistake I did, putting all unnecessary ContentPlaceHolders inside an invisible ASP:Panel.

Instead of this:

    <asp:Panel ID="Panel1" Visible="false" runat="server">
        <asp:ContentPlaceHolder ID="PlaceHolderPageImage" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderBodyLeftBorder" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderTitleLeftBorder" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderTitleAreaSeparator" runat="server" />
        <asp:ContentPlaceHolder ID="OSSConsole" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderTitleRightMargin" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderPageDescription" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderBodyAreaClass" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderTitleAreaClass" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderBodyRightMargin" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderCalendarNavigator" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderLeftActions" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderLeftNavBar" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderPageDescriptionRowAttr" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderPageDescriptionRowAttr2" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderFormDigest" runat="server">
            <SharePoint:FormDigest ID="FormDigest1" runat="server" />
        </asp:ContentPlaceHolder>
        <input type="text" name="__spDummyText1" style="display: none;" size="1" />
        <input type="text" name="__spDummyText2" style="display: none;" size="1" />
    </asp:Panel>

You shall do this:

    <div id="Panel1" style="display:none">
        <asp:ContentPlaceHolder ID="PlaceHolderPageImage" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderBodyLeftBorder" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderTitleLeftBorder" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderTitleAreaSeparator" runat="server" />
        <asp:ContentPlaceHolder ID="OSSConsole" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderTitleRightMargin" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderPageDescription" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderBodyAreaClass" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderTitleAreaClass" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderBodyRightMargin" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderCalendarNavigator" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderLeftActions" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderLeftNavBar" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderPageDescriptionRowAttr" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderPageDescriptionRowAttr2" runat="server" />
        <asp:ContentPlaceHolder ID="PlaceHolderFormDigest" runat="server">
            <SharePoint:FormDigest ID="FormDigest1" runat="server" />
        </asp:ContentPlaceHolder>
        <input type="text" name="__spDummyText1" style="display: none;" size="1" />
        <input type="text" name="__spDummyText2" style="display: none;" size="1" />
    </div>
Advertisements

From → SharePoint 2010

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: