0

The Scenario is:

I have a custom page in the central administration. I created it, deployed it(it worked ok) and now, on one of the servers I tried to access it(some time passed after I created it). It now shows this error when loading:

System.Runtime.InteropServices.COMException: Updates are currently disallowed on GET requests. To allow updates on a GET, set the 'AllowUnsafeUpdates' property on SPWeb. at Microsoft.SharePoint.Library.SPRequestInternalClass.ValidateFormDigest(String bstrUrl, String bstrListName) at Microsoft.SharePoint.Library.SPRequest.ValidateFormDigest(String bstrUrl, String bstrListName)

The problem is that on the page there are no unsafeupdates(no updates at all). Another thing, on a different server it works fine.

What I tried:

  • I tried to update the SPSolution it worked but didn't fix the problem;
  • I tried some powershell I saw on the internet:

$w = get-spwebapplication URL

$w.HttpThrottleSettings

$w.Update()

  • I tried IISreset and this didn't work as well

Any ideas?

Edit 1:

I have administrator rights on the server and full control over the database.

7
  • Do you have any stack trace of this error, maybe you're really trying to update some kind of 'Session' on SPWeb properties? May 20 '14 at 7:38
  • No this page just displays some statistics and does nothing else. Also, it works fine on two different servers
    – Gesh
    May 20 '14 at 7:47
  • Different server, but the same farm? May 20 '14 at 7:48
  • No different server, different farm. I updated my question with the full error from the logs.
    – Gesh
    May 20 '14 at 7:49
  • 1
    Then, maybe not the page is causing an issue, but whatever other custom solution (delegate control or something?) that's why any stack trace could be helpful. May 20 '14 at 7:50
0

You can get this error even when you page is not making any updates so this error is actually somewhat misleading. I can't quite remember what some of the triggers are as it's a while since I had that problem. However the fix is to set SPWeb.AllowUnsafeUpdates to true while you do whatever is causing the error e.g.:

using (SPWeb web = site.AllWebs[webID])
{
    bool allowUnsafe = web.AllowUnsafeUpdates;
    web.AllowUnsafeUpdates = true;

    //Do some stuff here

    web.AllowUnsafeUpdates = allowUnsafe;
}

If your willing to post your code I can probably work out the problematic bit if that helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.