문제

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