Monthly Archives: March 2012

Dynamically load JavaScript file

Sometimes you don’t always want a JavaScript file to load. If, for instance, a control that utilises it is loaded by a page that already references the same JavaScript file, you wouldn’t want to load the script file again. Note: … Continue reading

Posted in JavaScript | Tagged , | Leave a comment

Get List Items by Field Value

SharePoint Short #6 To retrieve all SPListItem objects that have a specified field value, instead of writing a CAML query, use the following LINQ statement: public List<SPListItem> GetItemsContainingValue(SPList list, Guid fieldId, string match) { List<SPListItem> matchingItems = (from SPListItem listItem … Continue reading

Posted in SharePoint Shorts | Tagged , | 2 Comments

Validation of viewstate MAC failed in AddWrkfl

I recently added a delegate control to a SharePoint solution. The delegate control was used to dynamically insert a custom user control into the master page. Part of the functionality of this control required the use of hidden fields. Everything … Continue reading

Posted in SharePoint, Workflow | Tagged , , | Leave a comment

Disable SharePoint PeopleEditor

SharePoint Short #5 If you have a requirement to disable the PeopleEditor in SharePoint through JavaScript, the following script will do this for you: function togglePeopleEditor(editor, enable) { // Disables the control but still allows the user to type into … Continue reading

Posted in SharePoint Shorts | Tagged , | Leave a comment