Home » C++ ProgrammingRSS

Getting Url of items Subfolders

I need to find the complete url of items in a list's subfolders. I have 10 levels of folders in my list and need to keep track of the urls of each item in the list that gets deleted. In the browser the Url looks ugly as it appends something after AllItems.aspx?Rootfolder=%2fen%2dCA%2fForEmployees%2fDocuments%2fFolder1&FolderCTID=&View=%7b42C8B4C0%2d1C33%2d419E%2dABC9%2dBAC0B7788844%7d

Is it possible to retrieve this Url programatically?

 

1 Answer Found

 

Answer 1

Hi! 

you can try something like this 

using (SPSite site = new SPSite(SPContext.Current.Site.Url))

            {

                using (SPWeb web = site.OpenWeb())

                {

                    SPList list = web.Lists["Shared Documents"];

                    SPListItemCollection items = list.Items;

                    foreach (SPListItem item in items)

                    {

                        string url = item.Url;

                    }

                }

            }

 

Thanks,

Kshitij Bishnoi

 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter