I am using the SharePoint client object model to create a web part.
I have a list on the parent site. This list has a field that is a choice field, with choices for all the subsites under the parent site. I am building a web part that will display items from the list on the parent site, but only if the item has that site's name in the above mentioned field. My problem is how do I get the current site? I know with the server object model, I can use SPContext.Current.Web. Alas, I cannot use the server object model. Can I accomplish something similar with the client object model?

Thank you in advance.

有帮助吗?

解决方案

You'll find desired object in Client Object Model under the clientContext object.

More details : MSDN

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top