Friday, March 8, 2013

while using spsecurity.runwithelevatedprivileges if we want to create or update a splistitem using the elevated previledges, we need to create new SPSite and SPWeb objects, but you would get an error “The security validation for this page is invalid …” since a new SPContext object is created.
 
There are two ways to get past this error
1) set SPWeb.AllowUnsafeUpdates = true
2) Use SPUtility.ValidateFormDigest()

No comments:

SSL Error - The connection for this site is not secure

 After cloning a git repo of dot net framework website and trying to run it all I could see was this error Turns out the fix was to simply e...