在VS2008中通过代码插入一条数据MOSS的列表时,可能出现下面的异常
Microsoft.SharePoint.SPException
The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.
解决方法:
在执行item.Update()之前先设置SPWeb对象的web.AllowUnsafeUpdates = true即可。