Home > SharePoint > The use of List GUID and Item ID as URL Parameters

The use of List GUID and Item ID as URL Parameters

Posted by Dominick Cosgrove at 9:34 AM Labels: , ,

The SPContext object has some very useful features. One of the freebie out of the box features is that it parses the URL and looks for the List GUID and Item ID. These can be used individually or in combination, providing an easy way to get the List instance or list item.

So if you pass in the List={GUID} as a URL parameter you can then get a reference to the list by SPContext.List.

Likewise if you provide both the List GUID and Item ID, e.g. _Layouts/myform.aspx?List={GUID}&ID={ItemID} you can get a reference to the list item by SPContext.Item.

Categories: SharePoint Tags:
  1. No comments yet.
  1. No trackbacks yet.