Contents tagged with SharePoint 2010

  • Trying to use Azure Shared Caching Session State with SharePoint 2010?

    Well, don't. The Microsoft.Web.DistributedCache .dll requires .NET 4.0, which doesn't work with SharePoint 2010. The fact that 4.0 is required for Microsoft.Web.DistributedCache is nicely buried in this thread, not in MSDN where it would have been, you know, helpful. Session State running in SQLServer mode works fine still, though. Let me know if I'm wrong, and also if anyone's tried the Table … more

  • Pro-Tip: Setting FBA Timeout When Using Claims Based Auth in SP2010

    If you're using claims based authentication in SharePoint 2010 and wondering why your Forms Based Authentication claims aren't reading your web.config timeout="x" values, it turns out that this is because they're managed on a different level by the Secure Token Service. The default timeout seems to be 10 hours (which seems a little excessive for most purposes) but you can change this easily via … more

  • SPGridView Gotcha: Filtering, ObjectDataSource and You

    Giving the SPGridView a good kick around today, seeing if it'll fit the bill for our development work - I came across two really great resources which I highly recommend for anyone looking to get a SPGridView up and going: Erik Burger's blogposts, Part 1 and Part 2 Kit Menke's note on potential filtering bugs with data that contains apostrophes So following those posts, I got my SPGridView up … more

  • SharePoint 2010 - Closing A Modal Dialog Within An UpdatePanel Programmatically

    SharePoint 2010 provides lots of nice of JavaScript helpers and methods, one category of which involves Modal Dialogs (eg the default behaviour when you view / edit a list item in a list). We can pretty easily create a modal dialog with a call to SP.UI.ModalDialog.showModalDialog(options) (and you can take a look at this blog post for a little more detail). So, let's imagine we open a dialog … more

  • Pro Tip: Client Side Validation with Nintex Forms

    To use the custom validation in Nintex, in the control settings, provide a method name for your custom validation for that specific control: And then you need to provide an implementation of the custom validation method you've named - this isn't documented anywhere on their site yet so I got the answer through a support ticket, but essentially you need to provide a method with the same name … more

  • Sharepoint 2010 Tip: Exception When Editing Pages - MediaWebPart and NullReference

    Had a confusing bug in a stage environment today where you could create pages (such as the inbuilt Article Page), but when you went to edit them it would through an exception: System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.SharePoint.Publishing.WebControls.MediaWebPart.get_WebPartAdderId() at Microsoft.SharePoint.Publishing.WebControls. … more

  • SharePoint Gotcha: Working with change tokens and change logs

    Was working on some code today, which was a timer job that used to work, but now doesn't. In the timer job, we had essentially something similar to the following: SPChangeToken changeToken = list.ParentWeb.Properties["mychangetoken"]; SPChangeCollection changedItems = null; SPChangeQuery queryitem = new SPChangeQuery(false, true); queryitem.Item = true; … more

  • Pro-tip: Resolving "Content Type Still In Use" Issues In SharePoint 2010

    If you're getting the following exception when trying to delete a content type ("Microsoft.SharePoint.SPException: The content type is in use"), here's a quick checklist of things to check: 1) SPContentTypeUsages. Using SharePoint Manager, you should be able to see whether your content type is used on any lists or libraries, and you haven't removed them yet. 2) Make sure you remove all items … more

  • Custom Search Refiners in SP2010 Gotcha

    I thought I'd blogged about this previously, but it turns out I haven't. So a colleague of mine ran into this issue where when you are setting the Filter Category Definition XML on the web part, after you save all the values reset, preventing you from customizing the refiners panel. If this is happening to you, make sure you uncheck the "Use default configuration" setting, or it won't persist … more

  • PreSaveAction() - Custom JavaScript when submitting SharePoint ListForms

    Here's a short but quick SharePoint 2010 tip if you're looking to easily hook into the save event on list item forms (either New or Edit forms). All you need is a custom javascript function named PreSaveAction() - as part of the out of the box saving procedure in SharePoint 2010, this method will automatically be called prior to the item being committed. This is useful for fields that you've … more

  • Pro-Tip: Change SharePoint Site Search Settings Programmatically

    If you need to change the Site Collection search settings (Such as the target search results page, or the dropdown properties), these settings are stored in the property bag for the web, not in an actual property of SPWeb. The property mappings are: SRCHENHFTR_URL – Search Center URL SRCHSITEDROPDOWN_MODE – Search Scope Dropdown Type SRCHTRAGETRESULTS_PAGE – Target Search Results page So … more

  • SP2010 SPF Workflow Part 5: List ID Lookups The Proper MS Way

    Finally after a couple of days of pain, I've got the end to end workflow which can be modified in SPD, and can be deployed to any site regardless of List/ListID...and here's the two biggest gotchas I encountered. Make sure you are developing your workflows on the same version of SP as the target environment – SPD is smart/crazy enough to generate .xsn task forms if you are connected to a SP2010 … more

  • SPD2010 Workflow Packaging Part 3: Custom Task Forms

    Following on from the previous two posts, here's another thing that you might have to do in order to get your workflow working correctly, if you've used any custom task forms or "Collect Data from User" actions. Many thanks to Benjamin Hutting and his blog post that pointed me in the right direction! What you'll find is that you will have deployed your workflow and everything is fine, until you … more

  • Manually Export SPD 2010 Reusable Workflow To Visual Studio 2010

    This post is part one of five around SharePoint Designer workflow deployments. Part Two (deprecated - no longer applicable) Part Three (custom task forms: infopath) Part Four (custom task forms: aspx/ascx) Part Five (listids) SharePoint Designer 2010 comes with a lot of improvements around Workflow creation and management, and one of the better new features are Reusable Workflows, allowing … more

  • SharePoint Deployment Error - Activate Features / Invalid Field Name

    Just a quick tip - if you ever get an error message like this while attempting to deploy your SharePoint solution: Error occurred in deployment step 'Activate Features': Invalid field name. {a41610db-0111-461c-8280-da6d0e28709d} One thing to check is that you've actually specified the Name property for your Field References - I had <FieldRef ID="{A41610DB-0111-461C-8280-DA6D0E28709D}" … more

  • VS2010 SharePoint Projects: Error occurred in deployment step 'Add Solution'

    The inbuilt Visual Studio 2010/Sharepoint 2010 tooling has improved significantly since the WSS 3.0 days, but there are still quite a few annoyances that crop up from time to time. One error which you might encounter is the following, when you are attempting to deploy what is otherwise a perfect solution: Error occurred in deployment step 'Add Solution': Value cannot be null. Parameter name: s … more

  • Managed Metadata Fields in SP2010 Content Type Definitions

    I've been creating some content types in SharePoint 2010 recently, which include a few of the new Managed Metadata Fields, and I came across an issue where items created with the content type wouldn't save, and would leave the following error message: Failed to get value of the “{0}” column from the “Managed Metadata” field type control. See details in log. Exception message: Invalid field name. … more

  • Sharepoint 2010 and SPWeb.AllProperties / SPWeb.Properties

    You're right - it's confusing. There's usually only one reason in SharePoint why things end up with totally non-common-sense names (see SPSite/SPWeb), and that reason is backwards compatibility. SPWeb.AllProperties is the recommended property bag for a SPWeb object, while SPWeb.Properties is maintained for the benefit legacy code. What's the difference between the two? SPWeb.Properties is a … more

  • Provisioning Files To A Feature's Root Folder In Sharepoint 2010

    I have been doing some work recently in InfoPath, and as part of investigating deployment of a custom InfoPath form to a Sharepoint installation, it was decided that we would use the not-so-well-documented XsnFeatureReceiver class in order to deploy the form to a site. However, there is a catch to using it - the .xsn must be placed in the root folder of the feature (ie 14/TEMPLATE/FEATURES/ … more

  • Search Results For Anonymous Users in Sharepoint 2010

    If you're using SharePoint for any public facing websites and are integrating search and are wondering why search results are not coming up when you're not logged in to the site, you aren't alone! Try performing the following simple steps: In your Sharepoint site, head to Site Settings --> Site Administration --> Search and Offline Availability, and change the Indexing ASPX Page Content … more