Custom controls 无法在自定义列表表单(新项目)上显示web部件错误

Custom controls 无法在自定义列表表单(新项目)上显示web部件错误,custom-controls,wss-3.0,Custom Controls,Wss 3.0,我想借此机会问一个问题,因为我真的找不到这个问题的根本原因 我在一个WSS3.0网站上工作,使用SPD2007,我对Sharepoint开发一般来说是相当陌生的 我正在自定义DispForm.aspx页面。该页面是一个简单的编辑页面,但在最后,我添加了一个自定义列表表单web部件,用于添加注释(存储在另一个列表中),并在下面添加了一个数据视图,用于查看与DispForm.aspx页面显示的项相关联的注释 我想做的与此页面上显示的功能相似,我从中获得了灵感,事实上,您可以看到我的最新评论: 一切

我想借此机会问一个问题,因为我真的找不到这个问题的根本原因

我在一个WSS3.0网站上工作,使用SPD2007,我对Sharepoint开发一般来说是相当陌生的

我正在自定义DispForm.aspx页面。该页面是一个简单的编辑页面,但在最后,我添加了一个自定义列表表单web部件,用于添加注释(存储在另一个列表中),并在下面添加了一个数据视图,用于查看与DispForm.aspx页面显示的项相关联的注释

我想做的与此页面上显示的功能相似,我从中获得了灵感,事实上,您可以看到我的最新评论:

一切正常,直到我删除了作为测试的所有评论。现在,我从自定义列表表单中得到的只是“无法显示此web部件错误”

我看了一下日志,我知道它在抱怨什么,但我不知道如何修复它,甚至不知道为什么会出现这样的错误

SPDataSourceView.ExecuteSelect() - selectArguments: IsEmpty=True, MaximumRows=0, RetrieveTotalRowCount=False, SortExpression=, StartRowIndex=0, TotalRowCount=-1
Error while executing web part: System.InvalidOperationException: Unable to open the specified list item. ---> 
System.ArgumentException: **Value does not fall within the expected range**.     
at Microsoft.SharePoint.SPList.**GetItemById**(Int32 id, String strRootFolder, Boolean cacheRowsetAndId)     
at Microsoft.SharePoint.SPList.GetItemById(Int32 id)     
at Microsoft.SharePoint.WebControls.SPDataSourceView.ExecuteSelect(DataSourceSelectArguments selectArguments)     --- End of inner exception stack trace ---     
at Microsoft.SharePoint.WebControls.SPDataSourceView.ExecuteSelect(DataSourceSelectArguments selectArguments)     
at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)     
at Microsoft.SharePoint.WebControls.SingleDataSource.GetXPathNavigatorInternal()     
at Microsoft.SharePoint.WebControls.SingleDataSource.GetXPathNavigator()     
at Microsoft.SharePoint.WebControls.SingleDataSource.GetXPathNavigator(IDataSource datasource, Boolean originalData)     
at Microsoft.SharePoint.WebPartPages.DataFormWebPart.GetXPathNavigator(String viewPath)     
at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform()
InnerException 1: System.ArgumentException: Value does not fall within the expected range.     
at Microsoft.SharePoint.SPList.GetItemById(Int32 id, String strRootFolder, Boolean cacheRowsetAndId)     
at Microsoft.SharePoint.SPList.GetItemById(Int32 id)     
at Microsoft.SharePoint.WebControls.SPDataSourceView.ExecuteSelect(DataSourceSelectArguments selectArguments)
我们讨论的是一个“新项”表单,所以我不明白为什么GetItemById会出错。它试图得到什么?我如何修复它

最后,我没有更改SPD创建的CAML查询。我确实对注释列表进行了更改,例如重命名或删除未使用的列,但我不认为这是问题的原因,因为删除自定义列表表单并重新创建它并不能解决问题

关于我应该去哪里或看什么有什么线索吗?我没有什么想法

谢谢

  • 在Sharepoint Designer中,打开将“注释”自定义列表表单插入的显示表单
  • 在代码视图中,找到列表的DataFormWebPart
  • 找到行