Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

Thanks

share|improve this question
add comment

1 Answer 1

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) {
      linkLists.Add(list);
   }
}
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
add comment

Your Answer

 
discard

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.