开发者

Security validation error when try get data from sharepoint using silverlight

开发者 https://www.devze.com 2023-01-17 18:00 出处:网络
I try to execute this code in Silcerlight 4 contol hosted in webpart: clientCtx = new ClientContext(ApplicationContext.Current.Url);

I try to execute this code in Silcerlight 4 contol hosted in webpart:

clientCtx = new ClientContext(ApplicationContext.Current.Url);
clientCtx.ValidateOnClient = true;
clientCtx.Load(clientCtx.Web);
clientCtx.ExecuteQueryAsync(updateConnectionStatus, Failed);

but it fails and go Failed method and I recive error: "The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again."

When I turn off security validation in开发者_JAVA技巧 central administration everything works. How to avoid this issue?


You might have a cross-domain posting issue. See the following SO question that deails how to provision the clientaccesspolicy.xml file to prevent cross-domain posting issues.

How can I add a ClientAccessPolicy.xml file to the SharePoint 2010 root folder?

0

精彩评论

暂无评论...
验证码 换一张
取 消