Hot answers tagged unsafe-updates
2
I have tried this code snippet (from console application):
using(SPSite site = new SPSite("http://mycoolsite"))
{
using(SPWeb web = site.OpenWeb())
{
SPList list = web.Lists["My List"];
SPField fldTitle = list.Fields["Title"];
fldTitle.Required = false;
fldTitle.Title = "New title";
...
1
For example, it's not safe to make updates and removal on GET requests, because someone may send you a link, you will click and item will be deleted. Thus it's strongly recommended to make updates on POST requests, thus the error is fired. In some cases it's really required to do and AllowUnsafeUpdates is used.
Please see this link and that link for ...
1
I would recomand you read this article from Waldek concerning problems revolving with web.GetFile() available at http://blog.mastykarz.nl/inconvenient-spwebgetfilestring/ and confront with your code, particularly when you passing a certain URL to the method.
1
With the newer CUs for SharePoint 2010 it's not necessary according to Microsoft
The packaging of cumulative updates changed as of August 31, 2011 ... As a result of the new packaging, it is no longer necessary to install the SharePoint Foundation cumulative update and then install the SharePoint Server cumulative update
On a new Installation/Upgrade ...
Only top voted, non community-wiki answers of a minimum length are eligible