SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have created a webpart. In webpart property I have put a browse button and using that I have to fetch all the list which are of Links List type. So that I can select a list and save into my web part.

Can anyone help me fetching the list that How to fetch all the lists which are of Links list type.


share|improve this question

It would be something like:

List<SPList> linkLists = new List<SPList>();
SPWeb web = SPContext.Current.Web;
foreach(SPList list in web.Lists) {
   if(list.BaseTemplate == SPListTemplateType.Links) {
share|improve this answer
Thanks MBSurf, for your suggestion. But the thing is I have to put a Browse button and I have to show all the list address there for selection. – Ankit Jun 27 '11 at 4:49
@Ankit: Sounds like you have some code to write! I don't expect @MBSurf to write all of the code for you. :) – Kit Menke Jul 15 '11 at 14:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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