Category Archives: Tips and Tricks

Wrapping JsonResults in ASP.NET MVC

Like a lot of web developers I like to load page content dynamically but this can cause problems if the Ajax request causes an error on the server. Timeouts can be handled in jQuery but what if the user needs … Continue reading

Posted in Reference, Tips and Tricks | Tagged , , , | Leave a comment

Calculating the Previous Month’s Date Range in SQL

Here’s a handy snippet that calculates the start and end dates for the previous month based on the current date. I find this very handy when I have an automated script that reports on the figures for only the last … Continue reading

Posted in Tips and Tricks | Tagged | Leave a comment

Wiki Markup Hyperlinks for WPF or HTML

This article shows an example of a Wiki-inspired markup for embedding hyperlinks in text – and how to render it as WPF and HTML. When building any kind of content management system, it’s a good idea to give users the … Continue reading

Posted in Tips and Tricks | Tagged , , | Leave a comment

Windows Azure Emulator – Unavailable Ports

I tried launching the Windows Azure Emulator today and hit the follow error: Role instances are taking longer than expected to start. Do you want to continue waiting? It turns out that the emulator has trouble starting if any of … Continue reading

Posted in Tips and Tricks | Tagged , , | Leave a comment

Timing a Method in C#

Here’s a very quick way to check the performance of a block of code. I’m wrapping a System.Diagnostics.Stopwatch class and sending all timings directly to Debug.WriteLine(). Please be aware that this is a very simplistic approach, and does not guarantee … Continue reading

Posted in Tips and Tricks | Tagged , | 2 Comments