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

来源:互联网 发布:2017云计算的上市公司 编辑:程序博客网 时间:2024/06/06 21:21

在处理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;       dosomethingcatch (Exception ex){  throw ex; }finally{ HttpContext.Current = savedHttpContext; }
0 0
原创粉丝点击