1

I want to get clientcontext in a visual sandbox webpart.

How can I do it without providing any credentials for url, as webpart will be on home page. I don't want to provide any credentials either, just want it to work like, SPContext.current....

string siteURL=”http://localhost“;
ClientContext clientContext = new ClientContext(siteUrl);
1

1 Answer 1

2
+50

Try to use: ClaimClientContext.GetAuthenticatedContext, instead of new ClientContext
http://community.office365.com/en-us/f/154/t/47576.aspx
http://msdn.microsoft.com/en-us/library/hh147177.aspx

1
  • I didn't get a chance to try it yet, but i will give you bounty Commented Apr 12, 2014 at 8:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.