locked
The control type 'System.Web.UI.WebControls.XmlDataSource' is not allowed on this page. The type is not registered as safe. after moving sharepoint web application to new moss 2007 sp2 environment RRS feed

  • Question

  • Hi all,

    I have just moved a share point 2007 web application running on a server(windows server 2003, 32 bit) with moss 2007 version below sp1 to  a server running moss 2007 sp2 and operating system is windows server 2008 r2 enterprise 64 bit.i followed content database attach method to move sharepoint side.

              After moving,when i browse to the new web application i get the error " The control type 'System.Web.UI.WebControls.XmlDataSource' is not allowed on this page. The type is not registered as safe. "

    I opened the site in sharepoint designer and i look for corresponding control,i  commented the follwing code on my default.aspx page

    "<!--<Sharepoint:SPNavigationManager
        id="QuickLaunchNavigationManager"
        runat="server"
        QuickLaunchControlId="QuickLaunchMenu"
        ContainedControl="QuickLaunch"
        EnableViewState="false" __Error="The type is not registered as safe.">
        <div>
            <asp:XmlDataSource runat="server" id="CountrySelectorXML" DataFile="/admin/HomeMenu.xml" XPath="/*/*" EnableCaching="False" />
            <SharePoint:AspMenu id="CountrySelector" DataSourceId="CountrySelectorXML" runat="server" Orientation="Vertical" StaticDisplayLevels="1" ItemWrap="true" MaximumDynamicDisplayLevels="0" StaticSubMenuIndent="0" SkipLinkText="Countries">
                <DataBindings>
                    <asp:menuitembinding DataMember="Item" TextField="name" NavigateUrlField="url" ImageUrlField="ImgUrl" />
                    <asp:menuitembinding DataMember="Items" TextField="name" NavigateUrlField="url" ImageUrlField="ImgUrl" />
                    <asp:menuitembinding DataMember="Country" TextField="name" NavigateUrlField="url" ImageUrlField="ImgUrl" />
                </DataBindings>
                <LevelMenuItemStyles>
                    <asp:menuitemstyle CssClass="ms-navheader1" />
                    <asp:menuitemstyle CssClass="ms-navitem" />
                </LevelMenuItemStyles>
                <LevelSubMenuStyles>
                    <asp:submenustyle CssClass="ms-navSubMenu1" />
                    <asp:submenustyle CssClass="ms-navSubMenu2" />
                </LevelSubMenuStyles>
                <LevelSelectedStyles>
                    <asp:menuitemstyle CssClass="ms-selectednavheader" />
                    <asp:menuitemstyle CssClass="ms-selectednav" />
                </LevelSelectedStyles>
            </SharePoint:AspMenu>
        </div>
        </Sharepoint:SPNavigationManager>-->
    "

    then i can browse to the web application,but as i commented this i cound nt see my leftnavigation bar.can any one please help me on resolving this error.

     

    Thanks in advance.

       


    subhash reddy
    Thursday, October 20, 2011 6:42 AM

Answers

  • Hi Subhash,

    You need to check whether System.web assembly is added as safe control in your application web.config file or not. If not, then please add the below line

    <SafeControl Assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Namespace="System.Web.UI.WebControls" TypeName="XmlDataSource" Safe="False" AllowRemoteDesigner="False" />

    Hope it could help

    Off Topic: There is duplicate thread of same problem in development forum, however it is not development problem. Moderator please delete the below duplicate thread

    http://social.msdn.microsoft.com/Forums/en/sharepointdevelopment/thread/f00884e7-6862-4f0a-824b-c70d9d77c382


    Cheers, Hemendra-MCTS "Yesterday is just a memory,Tomorrow we may never see"
    • Marked as answer by Subhash Reddy Thursday, October 20, 2011 8:02 AM
    Thursday, October 20, 2011 6:55 AM
    Moderator

All replies

  • Hi all,

    I have just moved a share point 2007 web application running on a server(windows server 2003, 32 bit) with moss 2007 version below sp1 to  a server running moss 2007 sp2 and operating system is windows server 2008 r2 enterprise 64 bit.i followed content database attach method to move sharepoint side.

              After moving,when i browse to the new web application i get the error " The control type 'System.Web.UI.WebControls.XmlDataSource' is not allowed on this page. The type is not registered as safe. "

    I opened the site in sharepoint designer and i look for corresponding control,i  commented the follwing code on my default.aspx page

    "<!--<Sharepoint:SPNavigationManager
        id="QuickLaunchNavigationManager"
        runat="server"
        QuickLaunchControlId="QuickLaunchMenu"
        ContainedControl="QuickLaunch"
        EnableViewState="false" __Error="The type is not registered as safe.">
        <div>
            <asp:XmlDataSource runat="server" id="CountrySelectorXML" DataFile="/admin/HomeMenu.xml" XPath="/*/*" EnableCaching="False" />
            <SharePoint:AspMenu id="CountrySelector" DataSourceId="CountrySelectorXML" runat="server" Orientation="Vertical" StaticDisplayLevels="1" ItemWrap="true" MaximumDynamicDisplayLevels="0" StaticSubMenuIndent="0" SkipLinkText="Countries">
                <DataBindings>
                    <asp:menuitembinding DataMember="Item" TextField="name" NavigateUrlField="url" ImageUrlField="ImgUrl" />
                    <asp:menuitembinding DataMember="Items" TextField="name" NavigateUrlField="url" ImageUrlField="ImgUrl" />
                    <asp:menuitembinding DataMember="Country" TextField="name" NavigateUrlField="url" ImageUrlField="ImgUrl" />
                </DataBindings>
                <LevelMenuItemStyles>
                    <asp:menuitemstyle CssClass="ms-navheader1" />
                    <asp:menuitemstyle CssClass="ms-navitem" />
                </LevelMenuItemStyles>
                <LevelSubMenuStyles>
                    <asp:submenustyle CssClass="ms-navSubMenu1" />
                    <asp:submenustyle CssClass="ms-navSubMenu2" />
                </LevelSubMenuStyles>
                <LevelSelectedStyles>
                    <asp:menuitemstyle CssClass="ms-selectednavheader" />
                    <asp:menuitemstyle CssClass="ms-selectednav" />
                </LevelSelectedStyles>
            </SharePoint:AspMenu>
        </div>
        </Sharepoint:SPNavigationManager>-->
    "

    then i can browse to the web application,but as i commented this i cound nt see my leftnavigation bar.can any one please help me on resolving this error.

     

    Thanks in advance.

       


    subhash reddy
    Thursday, October 20, 2011 6:41 AM
  • Hi Subhash,

    You need to check whether System.web assembly is added as safe control in your application web.config file or not. If not, then please add the below line

    <SafeControl Assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Namespace="System.Web.UI.WebControls" TypeName="XmlDataSource" Safe="False" AllowRemoteDesigner="False" />

    Hope it could help

    Off Topic: There is duplicate thread of same problem in development forum, however it is not development problem. Moderator please delete the below duplicate thread

    http://social.msdn.microsoft.com/Forums/en/sharepointdevelopment/thread/f00884e7-6862-4f0a-824b-c70d9d77c382


    Cheers, Hemendra-MCTS "Yesterday is just a memory,Tomorrow we may never see"
    • Marked as answer by Subhash Reddy Thursday, October 20, 2011 8:02 AM
    Thursday, October 20, 2011 6:55 AM
    Moderator
  • May be a vague suggestion but can you please check the web.config to verify System.Web.dll is registered in the safe controls or not?


    Thanks,
    Rakesh
    Thursday, October 20, 2011 7:10 AM
  • Dear hemendra,

    thanks for quick response. it worked for me :)


    subhash reddy
    Thursday, October 20, 2011 8:03 AM
  • This thread is already answered and this is the duplicate one. Here is the link of duplicate thread

    http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/b55bfbf1-a56d-41c4-a0a4-5687a69c453e/#5a4f005a-bc24-4d88-8ecd-f819e811c272

    Moderator please delete this duplicate thread.


    Cheers, Hemendra-MCTS "Yesterday is just a memory,Tomorrow we may never see"
    Thursday, October 20, 2011 8:22 AM
    Moderator