更新 Sharepoint 文档库中的文件

发布于 2024-07-19 16:00:32 字数 664 浏览 2 评论 0原文

简而言之,我在文档库中有一个自定义的 editForm.aspx,它使用我自己的自定义 dll。 当用户编辑记录时,我可以更新与该文件关联的所有属性,但是,当您更新实际文档(即替换它)然后 Update() (或 SystemUpdate())时,您会得到以下内容

: BLAH.doc 已由 DOMAIN\ACCOUNT 于 2009 年 5 月 1 日 09:41:12 +0100 修改。

文件被替换,但文件属性没有更新,所以路径和文件名与旧版本相同!?

这个帖子: http://hristopavlov.wordpress.com/2008/05/14/uploading-a-file-event-receivers-the-file-has-been-modified-by/ 建议使用事件接收器,就像任何在工作流程中遇到类似问题的人一样,使用DisableEvents()。 这很棒,但我不知道如何更改我的编辑表单以与事件接收器一起使用。 是否有关于更新文档库中的文件以及如何使用事件接收器来完成此操作的文档/教程?

Simply put, I have a custom editForm.aspx in a document library, that uses my own custom dll.
When a user edits a record, I can update all the properties associated with the file, however, when you update the actual document(ie replace it) and then Update() (Or SystemUpdate()), you get the following :

The file BLAH.doc has been modified by DOMAIN\ACCOUNT on 01 May 2009 09:41:12 +0100.

The file is replaced, but none of the file properties are updated, so path, and filename are the same as the old version!?

this posting:
http://hristopavlov.wordpress.com/2008/05/14/uploading-a-file-event-receivers-the-file-has-been-modified-by/
suggests using event recievers, as does anyone who has a similar problem with workflows, using DisableEvents(). Which is great, but I have no idea how to change my editform to work with an event reciever.
Is there any documentation/tutorials about updating a file in a document library, and how to use event receivers to accomplish this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

并安 2024-07-26 16:00:32

事件接收器将与编辑表单完全分开 - 除了保存用户输入的内容之外,您无需在编辑表单中执行任何特殊操作。 当您的表单或标准表单之一修改该项目时,将调用事件接收器。

The event receiver would be completely separate from the edit form - You don't do anything special in the edit form beyond saving whatever the user entered. The event receiver will be called when the item is modified by either your form or one of the standard ones.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文