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:

c# httpclient The remote certificate is invalid according to the validation procedure: RemoteCertificateNameMismatch

 If we get this error while trying to get http reponse using HttpClient object, it could mean that certificate validation fails for the remo...