- Published on
- Authors
- koskila
How to properly use SPWeb.AllowUnsafeUpdates
At times you may need to allow unsafe updates for SPWeb objects in order to get your code to run. This, in SharePoint's C# full-trust code, is done by setting SPWeb.AllowUnsafeUpdates to true. However, as this is an exception to security settings, you should generally avoid it. When you can't, it is good practice to limit the change to as small a scope as possible. This is true even though the setting only persisted for the duration of the request (unless the SPWeb object was gotten from SPSite.



