About      |       Articles      |      Services      |      Software      |      Contact

Latest Free SharePoint Software

ARB Security Solutions regularly releases free SharePoint software, including WebParts, Client Applications, Framework Extensions, and other Miscellaneous Components.
The most recent freeware is:

Title: Simple SharePoint Rollup WebPart
Date Published: 10/22/2009

Previous Two Free WebPart Releases:

SecureCenter For SharePoint

By SharePoint security integrators, for SharePoint security integrators.

SharePoint Security Assurance Program™

For externally facing SharePoint deployments, security is an acutely important deployment concern. Learn how through daily security scanning, you can ensure external business users and partners that they can collaborate in confidence!

Security Assurance WebPart:



Get SPList By URL In C#

There was a question posted in the development newsgroups about how to structure a different SPList return method then the orthodox SPWeb.GetList method out of the Microsoft.SharePoint namespace. Here is one that I use, which has some slight enhancements.

C#:
  1. public SPList ReturnListByUrl(string strPath)
  2. {
  3. if (strPath.ToLower().StartsWith("http"))
  4. {
  5. strPath = strPath.Substring(m_oWeb.Url.Length + 1);
  6. if (strPath.ToLower().StartsWith("lists"))
  7. {
  8. strPath = strPath.Substring(6);
  9. }
  10. }
  11. if (strPath.IndexOf("/")> 0)
  12. {
  13. strPath = strPath.Substring(0, strPath.IndexOf("/"));
  14. }
  15. return m_oWeb.Lists[HttpUtility.UrlDecode(strPath)];
  16. }

  • Share/Bookmark

8 Comments »

  1. [...] There was a question posted in the development newsgroups about how to structure a different SPList return method then the orthodox SPWeb.GetList method out of the Microsoft.SharePoint namespace. Here is one that I use, which has some slight enhancements Read More……(read more) [...]

    Pingback by Blogger Loser » Blog Archive » Get SPList By URL In C# — September 19, 2007 @ 6:42 am

  2. [...] Get SPList By URL In C# [...]

    Pingback by 11 Links Today (2007-09-19) — September 19, 2007 @ 8:23 am

  3. [...] There was a question posted in the development newsgroups about how to structure a different SPList return method then the orthodox SPWeb.GetList method out of the Microsoft.SharePoint namespace. Here is one that I use, which has some slight enhancements Read More……(read more) September 21st 2007 Posted to Uncategorized [...]

    Pingback by Blogger Loser » Get SPList By URL In C# — September 21, 2007 @ 11:24 am

  4. Method, described in the article will not work for international lists because there list names and relative paths are not the same:
    example: My библиотека
    but relative path will be the following:
    /lists/my/

    so the best solution is to use SPWeb.GetList method. But be careful – you must use ABSOLUTE path rather than relative as described in MSDN – it’s mistake.

    Comment by aleksey — October 9, 2007 @ 9:10 am

  5. Some examples of usage would be useful.

    Comment by Craig — May 22, 2008 @ 5:00 am

  6. If we change the list title from list settings, list name will be new title but list url will be the previous name of list( if we change from shrepont designer both will change).

    In this case above code will not work!!

    Comment by Shaiju Kumar — October 30, 2008 @ 11:21 pm

  7. Very good site! I like it! Thanks!i

    Comment by Willem — November 6, 2008 @ 11:54 pm

  8. [...] Get SPList by URL in C# [...]

    Pingback by Sharepoint search - Create an ‘Alert Me’ on individual search results | Dev All Day — March 1, 2010 @ 8:26 am

RSS feed for comments on this post. TrackBack URL

Leave a comment