Author Archives: briancaos

About briancaos

Developer at Pentia A/S since 2003. Have developed Web Applications using Sitecore Since Sitecore 4.1.

Sitecore publish:end and publish:end:remote

In Sitecore, you have several ways of executing code after a publish. The publish:end and publish:end:remote events are the 2 most obvious choices. There is a little confusion as to when in the publish pipeline these events are fired. In … Continue reading

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

Sitecore replace spaces with dashes in URL’s

In Sitecore, there is an easy of avoiding the %20 signs in your URL’s. To clarify: If you have an item with a space in the name, the space will appear in the URL as a %20 sign. For example, … Continue reading

Posted in Sitecore 7, Sitecore 8, Sitecore 9 | Tagged , | 1 Comment

Using C# HttpClient() from Sync and Async code

The .NEt 4.5 C# System.Net.Http.HttpClient() is a very nice http client implementation, but can be tricky to use if you (like me) are not a trained asynchronous programming coder. So here is a quick cheat sheet on how to work … Continue reading

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

Sitecore Postbacks not working? Contents not updated on button click? Try removing caching from your rendering

This is a classic Sitecore blunder – suddenly postbacks or button clicks have no effect, as if the web site no longer are connected to your webforms codebehind or the MVC renderings. And you have not changed any code. But … Continue reading

Posted in Sitecore 5, Sitecore 6, Sitecore 7, Sitecore 8, Sitecore 9 | Tagged , | Leave a comment

Sitecore SOLR error: Invalid Date in Date Math String

There seems to be an issue with certain combinations of Sitecore, SOLR and the local machine datetime settings. This is the error: ManagedPoolThread #11 12:20:50 INFO Job started: Index_Update_IndexName=sitecore_master_index ManagedPoolThread #11 12:20:50 ERROR Exception Exception: System.Reflection.TargetInvocationException Message: Exception has been … Continue reading

Posted in Sitecore 6, Sitecore 7, Sitecore 8, Sitecore 9 | Tagged , , | Leave a comment

Sitecore separate users from CORE database – move membership provider to separate database

Since Sitecore 6, Sitecore have had the .NET membership tables in the CORE database. And since every instance of Sitecore needs access to the CORE database, it might seem as a good place to store them. But separating the users … Continue reading

Posted in Sitecore 6, Sitecore 7, Sitecore 8 | Tagged , | 3 Comments

Sitecore Rule – Personalize based on any field in any facet in your Contact

This Sitecore Personalization Rule was developed by my colleague Martin Rygaard with the purpose of being able to personalize on any field in any facet on a contact. STEP 1: CREATE THE CONDITION Create a new “Condition” below /sitecore/system/Settings/Rules/Definitions/Elements/??? The text … Continue reading

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

C# Using Newtonsoft and dynamic ExpandoObject to convert one Json to another

The scenario where you convert one input Json format to another output Json is not uncommon. Before C# dynamic and ExpandoObject you would serialize the input Json to POCO model classes and use a Factory class to convert to another … Continue reading

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

.NET Session state is not thread safe

When working with the .NET session state you should bear in mind that the HttpContext.Current.Session cannot be transferred to another thread. Imagine that you, from the Global.asax would like to read the SessionID each time a session is started: To … Continue reading

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