Updates are currently disallowed on GET requests. To allow updates on a GET, set the 'AllowUnsafeUp

在处理sharepoint的term value赋值时出现了如下错误.

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

解决方案:

1.如果是用Ajax请求处理更新item的 Term or Termset,最好改用POST,

2.如果必须用GET方式需要,则需要做以下处理.

HttpContext savedHttpContext = HttpContext.Current; 
try { 
      HttpContext.Current = null; 
      dosomething
catch (Exception ex)
{  throw ex; }
finally
{ HttpContext.Current = savedHttpContext; }


你可能感兴趣的:(SharePoint)