ListItem Updating事件监视有没有上传附件
2024-10-21 05:39:47
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;
using System.Web; namespace MyProject.Features
{
public class MyEventReceiver : SPItemEventReceiver
{
HttpContext currentContext; public MyEventReceiver()
{
currentContext = HttpContext.Current;
} public override void ItemAdding(SPItemEventProperties properties)
{
if (currentContext != null)
{
if (currentContext.Request.Files.Count > 0)
{ // there are attachments }
else
{ // there are no attachments }
}
}
}
}
我之前也以为能用item.Attachment.count去监视,后来发现这个时候都还是正在更新,并不能监视此时有没有附件。
所以用HttpContext.Current;来监视是最好的,因为它可以监视上传流。
最新文章
- ASP.NET Core的路由[5]:内联路由约束的检验
- RC上电复位时间计算
- SSAS:概念梳理
- 纯CSS最小响应网格布局
- 移动端页面的head头部内容
- 你所不知道的html5与html中的那些事第三篇
- PCAP 文件内容解析命令
- 转:CFile::Seek
- 移植ffmpeg到VC环境心得
- APIJSON-以坚持和偏执,回敬傲慢和偏见
- ROS学习笔记(一) : 入门之基本概念
- Git入门到高级系列1-git安装与基础命令
- C++ 使用openssl库实现 DES 加密——CBC模式 &;&; RSA加密——公加私解——私加公解
- fastIO
- delphi 控制音量 静音的类
- python3 安装使用 fabirc3 模块以及 fab 命令(转)
- HUE的安装
- git ingore添加忽略文件无较的解决方法
- Struts2(三)配置详解
- 编程中检查IIS7组件的安装情况