Category Archives: .net

Sitecore General error when submitting contact – Another contact with the same identifier already exists

In Sitecore when creating your own contacts you can get the following exception: 10604 10:16:27 ERROR General error when submitting contact. Exception: System.InvalidOperationException Message: Another contact with the same identifier already exists. Source: Sitecore.Analytics.MongoDB at Sitecore.Analytics.Data.DataAccess.MongoDb.MongoDbDataAdapterProvider.SaveContactWithIdentifier(IContact contact, ContactSaveOptions saveOptions) at … Continue reading

Posted in .net, c#, General .NET, Sitecore 8 | Tagged , , , , , | 1 Comment

Sitecore Advanced Configuration in .config files

Sitecore allows you to create configuration sections in /configuration/sitecore/ that consists of hierarchies of configurations including lists, and it will even help you serialize the configuration to object instances. Observe the following real life example of a configuration I created to … Continue reading

Posted in .net, c#, General .NET, Sitecore, Sitecore 5, Sitecore 6, Sitecore 7, Sitecore 8 | Tagged , , , , | Leave a comment

Azure CloudQueue, Get and Set Json using Newtonsoft.Json and Microsoft.WindowsAzure.Storage

The Microsoft Azure Cloud have a nice simple Queue mechanism in their Azure Storage where you can store up to 64 kb of data for up to 7 days. The queue is very easy to set up and very easy … Continue reading

Posted in .net, c#, General .NET | Tagged , , , , | Leave a comment

Sitecore Contacts – Create and save contacts to and from xDB (MongoDB)

The Sitecore Contact is the cornerstone of the Sitecore Experience Platform and is the place where you store every data you know about any contact, named and anonymous. UPDATE: 09-09-2016: CreateContact Updated: Thanks to moginheden for the update. UPDATE: 27-09-2016: … Continue reading

Posted in .net, c#, General .NET, Sitecore 8 | Tagged , , , , , , , , | 14 Comments

Sitecore locating sublayouts on your webpage

This is a followup from the post, Get Sitecore placeholders and rendering hierarchy from a Sitecore item, where I adress one of the difficulties when working with pages in Sitecore, that they tend to get very complex as one page may … Continue reading

Posted in .net, Sitecore 6, Sitecore 7, Sitecore 8 | Tagged , , , , , | 5 Comments

Sitecore contact facets – Create your own facet

This article describes how to create a simple Sitecore facet consisting of a DateTime and a list of strings. A contact is made up of facets. Here are all the facets Sitecore uses (you will find the facets in \App_Config\Include\Sitecore.Analytics.Model.Config): In … Continue reading

Posted in .net, c#, General .NET, Sitecore 8 | Tagged , , , , , , , , | 12 Comments

URL Rewrite and Sitecore

The Microsoft URL Rewrite module is an ISS extension that allows you to rewrite one URL to another using regular expressions. The extension is like the Sitecore aliases on steroids, and is especially useful for mapping old dynamic URL’s to … Continue reading

Posted in .net, c#, General .NET, Sitecore 6, Sitecore 7 | Tagged , , , , | Leave a comment

Sitecore 7 create item and update index at the same time

With Sitecore 7, the Sitecore index (based on Lucene.NET) have greatly improved, thus making the index even more usable. One thing you should know though, is that when you add items to Sitecore using the Sitecore.Data.Items.Item.Add() method, the index is … Continue reading

Posted in .net, c#, Sitecore 7 | Tagged , , , , | 3 Comments

Stream Sitecore media items to HttpResponse

Here is a small tip for you who is doing API’s based on Sitecore. How to get an item from the Sitecore Media Library and stream it to the HttpResponse of a page. This is an example of an .ashx … Continue reading

Posted in .net, c#, Sitecore 7 | Tagged , , , | Leave a comment

Register local search terms in Sitecore DMS

When installing Sitecore and DMS, Sitecore comes pre-installed with an Executive Insight Dashboard Report that will generate a report containing which search words users have executed in your local search page. All you need to do is to register a … Continue reading

Posted in .net, c#, Sitecore 6, Sitecore 7 | Tagged , , , , | 1 Comment