惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Privacy International News Feed
WordPress大学
WordPress大学
Security Latest
Security Latest
Cyberwarzone
Cyberwarzone
K
Kaspersky official blog
Cisco Talos Blog
Cisco Talos Blog
Microsoft Security Blog
Microsoft Security Blog
G
GRAHAM CLULEY
N
News | PayPal Newsroom
Apple Machine Learning Research
Apple Machine Learning Research
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Visual Studio Blog
美团技术团队
J
Java Code Geeks
I
Intezer
The Cloudflare Blog
SecWiki News
SecWiki News
S
Secure Thoughts
Microsoft Azure Blog
Microsoft Azure Blog
V2EX - 技术
V2EX - 技术
C
Cyber Attacks, Cyber Crime and Cyber Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Spread Privacy
Spread Privacy
D
DataBreaches.Net
S
Security Affairs
Help Net Security
Help Net Security
S
Securelist
F
Full Disclosure
C
Check Point Blog
F
Fortinet All Blogs
Know Your Adversary
Know Your Adversary
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Y
Y Combinator Blog
云风的 BLOG
云风的 BLOG
阮一峰的网络日志
阮一峰的网络日志
The Register - Security
The Register - Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
人人都是产品经理
人人都是产品经理
博客园_首页
G
Google Developers Blog
Google Online Security Blog
Google Online Security Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Help Net Security
酷 壳 – CoolShell
酷 壳 – CoolShell
I
InfoQ
Application and Cybersecurity Blog
Application and Cybersecurity Blog
H
Hacker News: Front Page
L
LINUX DO - 热门话题
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
LangChain Blog

博客园 - Ken Lin

Oracle VS Sql Server Asp.net常用的一些代码(转) - Ken Lin - 博客园 Sharepoint工作流任务权限问题 WSS 扩展文件夹属性-应用场景一 内容查询Web 部件定制 How to submit data in InfoPath form services Form Services方式发布带有Managed Code的表单模板 WSS 代码执行的权限提升 用代码访问InfoPath表单内容 STSADM 进行MOSS的备份与迁移 利用SharePoint Designer更改任务列表状态栏显示 MOSS 工作流(二)自定义开发 MOSS-自定义字段类型 通过Web Part Connection 在Web Part 之间传递数据(二) 通过Web Part Connection 在Web Part 之间传递数据(一) WebPart 生存周期 QuickPart中文字符显示问题 MOSS SP1 解决Ajax Extension 对Webpart的兼容性问题 MOSS 工作流(一)
MOSS开发Tips
Ken Lin · 2008-07-23 · via 博客园 - Ken Lin

EventHandler:

问题:

最近在开发Eventhandler的时候发现ItemAdded这个方法中如果有对列表项进行更新操作,即执行了item.Update() ,那么就会触发ItemUpdated这个eventhandler事件,我们的本意是编辑,修改的时候

去触发ItemUpdated这个eventhandler

public override void ItemAdded(SPItemEventProperties properties)

{    

properties.ListItem.Update();

}

public override void ItemUpdated(SPItemEventProperties properties)

{

     //update code here

}

解决办法:

添加DisableEventFiring() 这个方法,阻止其他事件被调用

public override void ItemAdded(SPItemEventProperties properties)

{

     DisableEventFiring(); //Prevents events from being raised.

    

properties.ListItem.Update();

}

或者不使用properties.ListItem.Update();

改为properties.ListItem.SystemUpdate();

public override void ItemAdded(SPItemEventProperties properties)

{

    

properties.ListItem. SystemUpdate();

}

Splistitem.SystemUpdate Updates the database with changes made to the list item without effecting changes in the modified time or modified by fields.

用户,查阅项数据类型

我们用代码访问用户或查阅项数据类型时候要做些字符串的处理,再使用该数据,

因为这俩中类型,我们用代码item["Author"].ToString()得到的字符串格式是id;#displayname 

        ///get the id by string format as: id;#displayname

        ///查询项,用户字符串

        public static int getID(string val)

        {

            return Int32.Parse(val.Substring(0, val.IndexOf(';')));

        } 

        ///get the displayname by string format as: id;#displayname

        ///查询项,用户字符串

        public static string getDisplayname(string val)

        {           

            return val.Substring(val.IndexOf('#') + 1);

        }

Workflow:

workflow.xml 配置

一个工作一般都有初始化表单和任务表单,但有的情况我们不需要初始化表单,即该工作流只有任务表单,这样的话,workflow.xml配置文件就需要作相应修改.

有初始化表单必须有这些节点:

<Workflow

InstantiationUrl="_layouts/IniWrkflIP.aspx"
ModificationUrl="_layouts/ModWrkflIP.aspx">

<MetaData>

<Instantiation_FormURN/>

<Task0_FormURN/>

<StatusPageUrl>_layouts/WrkStat.aspx</StatusPageUrl>

</MetaData>

</Workflow>

只有任务表单的工作流(如果不这样,工作流就会发生错误):

<Workflow
ModificationUrl="_layouts/ModWrkflIP.aspx">

<MetaData>

<Task0_FormURN/>

<StatusPageUrl>_layouts/WrkStat.aspx</StatusPageUrl>

</MetaData>

</Workflow>