views:

15

answers:

1

I need to list out the Custom list and library from SharePoint Site? How to identify the content is comes under the custom created?

+1  A: 

Below code should help you

            SPList myList=SPContext.Current.Web.Lists["YourList"];
            if (myList.BaseType == SPBaseType.DocumentLibrary)
            {
                //My List is Document Library
            }

            if (myList.BaseType == SPBaseType.GenericList)
            {
                //My List is Custom List
            }
Kusek
i tried to get the current web using client object model.i am not able to get that..please guide me to find itClientContext context = new ClientContext(ApplicationContext.Current.Url);ithis is available in net.. but its not working
Ayyappan.Anbalagan