Sharepoint 2010 删除时,根网站中已设置的XlstViewWebPart给我的列表不存在

Sharepoint 2010 删除时,根网站中已设置的XlstViewWebPart给我的列表不存在,sharepoint-2010,Sharepoint 2010,考虑以下几点: 我有一个管理子网站,其中包含所有列表和文档库,我使用XlstViewWebPart以编程方式在根网站中提供大多数文档库,当我尝试选择一个项目并使用功能区上的“删除”按钮删除它时,我得到: 服务器遇到以下错误: 列表不存在。所选页面包含不存在的列表。它可能已被其他用户删除。 但是如果从项目弹出菜单中删除该项目,它将正常工作并被删除 平台:SharePoint Server 2010 SP1,VS 2010,CU 2012年6月 提前谢谢 ======================

考虑以下几点:

我有一个管理子网站,其中包含所有列表和文档库,我使用XlstViewWebPart以编程方式在根网站中提供大多数文档库,当我尝试选择一个项目并使用功能区上的“删除”按钮删除它时,我得到:

服务器遇到以下错误: 列表不存在。所选页面包含不存在的列表。它可能已被其他用户删除。

但是如果从项目弹出菜单中删除该项目,它将正常工作并被删除

平台:SharePoint Server 2010 SP1,VS 2010,CU 2012年6月

提前谢谢

========================================

更新(提供web部件的我的代码)
可能是因为您的列表属于另一个站点(或子站点),而SP说您没有该列表,所以发生了错误。 尝试在站点中创建列表,然后再次删除。
如果它不起作用,请向我们显示您的XlstViewWebPart代码。

感谢您的回复,是的,该列表属于子站点,由根站点中的代码设置。我用代码更新我的帖子。
            Dim _web As SPWeb = SPContext.Current.Site.RootWeb

        Try
            'Get refrence to publishing web
            Dim _pubWeb As PublishingWeb = PublishingWeb.GetPublishingWeb(_web)
            Dim WPM As Microsoft.SharePoint.WebPartPages.SPLimitedWebPartManager

            If _pubWeb IsNot Nothing Then
                'Loop each publishing page in the web
                'Check out the file
                'If the current page have CustomWebPart (It is an Custom System Page), Then
                'If XsltListViewWebPart is not provisiond (double check in case of click the button more than one time), then
                'Create an XsltListViewWebPart
                'Assign properties of the new XsltListViewWebPart with Document Lib. Name and Admin web
                'Add the new XsltListViewWebPart to the current page in the loop
                For Each curPage As PublishingPage In _pubWeb.GetPublishingPages()
                    If curPage.ListItem.File.RequiresCheckout AndAlso curPage.ListItem.File.CheckOutType = SPFile.SPCheckOutType.None Then curPage.CheckOut()

                    WPM = curPage.ListItem.File.GetLimitedWebPartManager(System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared)

                    Dim CustomWebPart As CustomWebPart = WPM.WebParts.OfType(Of CustomWebPart)().FirstOrDefault()

                    If CustomWebPart IsNot Nothing Then
                        If CustomWebPart.DocLibName.ToLower = Constants.List.MeetingSchedular.ListName.ToLower Then Continue For

                        Dim web As SPWeb = _web.Site.RootWeb.Webs(Constants.WebNames.AdminWeb) 'Get Admin Web
                        Dim LVWP As WebPartPages.XsltListViewWebPart = WPM.WebParts.OfType(Of WebPartPages.XsltListViewWebPart)().FirstOrDefault()

                        If LVWP Is Nothing Then
                            LVWP = New WebPartPages.XsltListViewWebPart

                            Dim lst As SPList = web.Lists(CustomWebPart.DocLibName)

                            With LVWP
                                .WebId = web.ID
                                .ViewGuid = lst.DefaultView.ID.ToString("B").ToUpper()
                                .ListName = lst.ID.ToString("B").ToUpper()
                                .ListId = lst.ID
                                .ListUrl = "/Admin/" + CustomWebPart.DocLibName
                                .TitleUrl = "/Admin/" + CustomWebPart.DocLibName
                                .ChromeType = System.Web.UI.WebControls.WebParts.PartChromeType.None
                                .AllowClose = False
                                .AllowEdit = True
                                .AllowMinimize = True
                                .AllowConnect = True
                            End With

                            _web.AllowUnsafeUpdates = True
                            WPM.AddWebPart(LVWP, "MainZone", 0)

                            curPage.Update()
                            _web.AllowUnsafeUpdates = False
                        End If

                        curPage.CheckIn("By cmdProvisionWebParts_Click")
                        curPage.ListItem.File.Publish("By cmdProvisionWebParts_Click")
                    End If
                Next
            End If
            RegisterNotification("Provision Web Parts Completed successfully")
        Catch ex As Exception
            SiteHelper.WriteErrors("Custom_Settings.ProvisioningRootWebParts", ex)
            RegisterNotification("Error: " + ex.Message)
        End Try