How to get the full URL from SPListItem in SharePoint

The SPListItem URL property does return the URL for the SPListItem including the List/Documetn Library name, but it doesn’t return the full URL including the server and site names.

To get the full URL, you can either concatenate the SPLIstItem.Web.Url and the SPListItem.URL, or extract the full URL from the SPListItem.XML data like this:

 

 

Of course, you should add the usual error handling and checking.

 

Leave a Reply

Your email address will not be published. Required fields are marked *