'项目不存在'读取SharePoint 2010列表时出错 [英] 'Item Does Not Exist' error reading SharePoint 2010 List

查看:53
本文介绍了'项目不存在'读取SharePoint 2010列表时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在SharePoint 2010中有一个列表.如果我以编程方式(通过自定义Webpart)将项目添加到列表中,则以后可以阅读这些项目并将其显示在其他Web部件中.但是,如果尝试读取通过Web界面添加的列表项,则会在Webpart中收到以下错误:

I have a list in SharePoint 2010. If I add items to the list programmatically (via a custom webpart), I can later read those items and show them in other web parts. However, if I attempt to read a list item added through the web interface, I get the following error in my webpart:

该项目不存在.您选择的页面包含一个不存在的项目.它可能已被另一个用户删除.0x81020016

奇怪的是,在调试器中,我看到正确读取了列表项.我正在把剩下的头发拉出来.

The weird part is, in the debugger, I see that the list item is properly read. I'm pulling what's left of my hair out over this one.

有什么想法吗?

这是任何关心的人的答案:

Here's the answer for anyone who cares:

我这样称呼我的页面-mywebpage.aspx?id = 1,其中id = 1是我希望Webpart显示的列表中项目的ID.出于某些仅Microsoft已知的原因,在查询字符串中使用'id'是不可以的.因此,我将参数名称更改为"lid",现在一切正常.

I was calling my page like this - mywebpage.aspx?id=1, where id=1 was the id of the item in the list I wanted my webpart to display. For some reason known only to Microsoft, using 'id' in the query string is a no-no. So I changed the param name to 'lid' and now everything works like I would expect.

感谢大家的回应.

推荐答案

好吧,我想我已经找到了.我这样称呼我的页面-mywebpage.aspx?id = 1,其中id = 1是我希望Webpart显示的列表中项目的ID.由于只有Microsoft知道的某些原因,在查询字符串中使用'id'是不可以的.因此,我将参数名称更改为"lid",现在一切正常.

Well, I think I've found it. I was calling my page like this - mywebpage.aspx?id=1, where id=1 was the id of the item in the list I wanted my webpart to display. For some reason known only to Microsoft, using 'id' in the query string is a no-no. So I changed the param name to 'lid' and now everything works like I would expect.

感谢大家的回应.

这篇关于'项目不存在'读取SharePoint 2010列表时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆