SPListItem 事件接收器不执行 ItemAdded 事件
我使用 SharePoint 2010 和 Visual Studio 2010 创建了一个项目事件接收器。该事件接收器执行 ItemDeleting
但无法执行 ItemAdding
或 ItemAdded
> 事件。
我的问题是我在编辑表单中上传该项目的图像,因此我想在添加新项目后打开编辑表单,因此我假设我可以在该项目的“已添加”事件中重定向到编辑页面。
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Receivers ListTemplateId="10002">
<Receiver>
<Name>SharedItemListEventRecieverItemDeleting</Name>
<Type>ItemDeleting</Type>
<Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
<Class>ListDefinitions.ListsEventRecievers.SharedItemListEventReciever.SharedItemListEventReciever</Class>
<SequenceNumber>10000</SequenceNumber>
</Receiver>
</Receivers>
</Elements>`
I've created an item event receiver using SharePoint 2010 and Visual Studio 2010. The event receiver executes ItemDeleting
but it can't execute ItemAdding
or ItemAdded
events.
My problem is I upload images for the item in edit form so I want to open the edit form after adding the new item, So I assume that I can make redirect to the edit page in the Added event of the item.
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Receivers ListTemplateId="10002">
<Receiver>
<Name>SharedItemListEventRecieverItemDeleting</Name>
<Type>ItemDeleting</Type>
<Assembly>$SharePoint.Project.AssemblyFullNamelt;/Assembly>
<Class>ListDefinitions.ListsEventRecievers.SharedItemListEventReciever.SharedItemListEventReciever</Class>
<SequenceNumber>10000</SequenceNumber>
</Receiver>
</Receivers>
</Elements>`
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于事件接收器触发 ItemAdding 和 ItemAdded,您需要更改 elements.xml,如下所示:
`
For event receiver fire ItemAdding and ItemAdded, you need to change elements.xml as follow:
`