Wednesday, September 12, 2007

Let's Talk about .. MOSS2007-Error on AllowUnsafeUpdate

Yesterday I tried to delete the SharePoint item in the loop by using item.delete()
Then, I got this error message,

"Updates are currently disallowed on GET requests. To allow updates on a GET, set the 'AllowUnsafeUpdates' property on SPWeb."

So, I searched at Google and found many people've ever got this problem. I used the solution of Robin's Sharepoint Blog. And it's worked.

However, I got the second one,

"Collection was modified; enumeration operation may not execute."

Then, I searched again. I know from the MBR IT Soluctions web that because I used the foreach loop that is incremented by the SharePoint items which was deleted.