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.


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) {
  • 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, 2011 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, 2011 at 14:23

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.