質問

Sharepoint 2013

When i try to add a user to SharePoint Groups or simply give authorisations to different SP groups the page doesn't load and give the following error :

''The security validation for this page is invalid''

I've looked around on the interwebs and lots of posts seem to point towards adding the AllowUnsafeUpdates value to true, but since the modifications i'm trying to do aren't on a specific page i tried to add

Web.AllowUnsafeUpdates = true;

To my master page but it doesnt seem to take the code. Do i need a different type of code for the master page? Am i putting the value in the wrong spot? Thanks for you help

役に立ちましたか?

解決

Try this, write your code in between this. This could be permission issue of current user login.

SPSecurity.RunWithElevatedPrivileges(delegate()
{
});

Also, if won't work also write this code

ElevatedsiteColl.WebApplication.FormDigestSettings.Enabled = false;
ElevatedsiteColl.AllowUnsafeUpdates = true;
wb.AllowUnsafeUpdates = true;

and in our finally block we reset the values to its initial state

finally
{ 

ElevatedsiteColl.WebApplication.FormDigestSettings.Enabled = true;
  wb.AllowUnsafeUpdates = false;

ElevatedsiteColl.AllowUnsafeUpdates = false;

}
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top