1

How can I access list that is located at the root site from a sub site?

3
  • 3
    Can you explain how you need to access it? I.e. in code, via rollup, OOB webpart, etc..
    – Dave Wise
    Commented Sep 19, 2012 at 20:19
  • type its url in the browser. Commented Sep 19, 2012 at 21:23
  • I wanted to have a list on the root that several subsites could use the data in that root list as look up values in subsite specific lists.
    – Jjp
    Commented Sep 20, 2012 at 12:24

2 Answers 2

1

Using C#, dead simple:

SPWeb rootWeb = SPContext.Current.Site.RootWeb;
SPList targetList = rootWeb.Lists["MyTargetListName"];
1
  • Thank you - but I need an out of the box solution or a solutions that uses designer.
    – Jjp
    Commented Oct 3, 2012 at 15:01
1

For security reasons (and technical ones as well) SharePoint does not support using lists outside of the current site as a lookup list.

You could do one of the following:

1) Create a template of the main list with data and use that to replicate the list everywhere you need it

2) Use an InfoPath form. The lookup would happen within the InfoPath form, not in the SharePoint column itself. InfoPath can use list data from other SharePoint sites in its data connections.

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.