Monday, July 5, 2010

Accessing the Content Fields of a SharePoint page

I needed to access the properties/content fields of a SharePoint page programatically and achieved this with the following code:

SPField field = SPContext.Current.List.GetField("Level 1 Group Summary");


string value = field.FieldRenderingControl.ListItemFieldValue.ToString();

Or
value = field.FieldRenderingControl.ItemFieldValue.ToString();

No comments: