Deleting a project from Hosted TFS

I added a project to the wrong TFS collection! Now what? Removed all the bindings from my solution but the TFS service now points to an orphaned entry. Unfortunately, up to this day, the TFS team have not been kind enough to supply us with a GUI tool that can delete a project from the repository and clear all references to it. Google to the rescue. After spending several minutes looking around, the answer to this issue became apparent. The documentation is incorrect. So these are the steps required in order to delete a project from TFS. Remove all bindings …[read more]


XML Validation Failure Due To Invincible White Space

After spending 3 hours of my life trying to resolve the following error message: The element cannot contain white space. Content model is empty I decided to share my solution in hope that this will help somebody else. The xml file that was failing validation is: <?xml version="1.0" encoding="utf-8"?> <ComponentSet Default="Create Data Set"> <Procedures> <Procedure Name="Create Data Set"> <MainFlow> <CreateDataSetVersion Name="run create data set version task" Description="this the description" CollectionId= …[read more]


Tidy up your forms with horizontal sliding divs using JQuery UI

Many websites still make use of lengthy scrollable forms or numerous page post backs when requesting input from their users, e.g shopping cart check outs etc. jQuery and jQueryUI give developers the opportunity to significantly improve the overall UI experience. In this tutorial, we will look into creating sliding panels/divs that respond to user input and allow the users to navigate through the data entry process in a nice, fluid way. First we need to ensure that we reference the appropriate libraries: jQuery 1.9.0 jQueryUI 1.9.2 Then we need to create our html elements: …[read more]


Uncaught Type Error: Object [object Object] has no method '' – jQuery Error

Many developers have been caught up by this error message judging by the number of posts on StackOveflow! I had to spend a few hours with this exception until finding the solution. Now I know that writing code while tired is never a good thing! The problem started when I tried to integrate the FileDrop jQuery plugin to my MVC 4 project. After adding all the files and JavaScript code, I was greeted by this perplexing error message: Object [object Object] has no method.. This error, in most cases, means that jQuery is not working and no such function can …[read more]


Checking if a generic collection is empty with Linq and C#

This is a common issue for many developers. How do you quickly and efficiently determine whether a given non-null collection contains any valid non-empty elements . The string class is cool because you can use the string.IsNullOrEmpty(yourstring); to test for null and/or empty. Unfortunately, generic collections don’t implement a similar method. There are two ways to deal with this. The first one requires you to write an extension for generic collections like this: public static bool IsEmpty<T>(this IEnumerable<T> list) { if (list is ICollection<T>) return ((ICollection<T& …[read more]


HTML5 Drag and Drop file upload with preview using jQuery and MVC 4

With the advent of HTML5 and its wide adoption by all major browsers, web developers now have a new arsenal in their hands for implementing powerful file upload functionality on their website. In this tutorial we will see how to implement this using the FileDrop jQuery plugin and an MVC controller to receive and store the uploaded files in a repository on the server. First create a new MVC 4 website in Visual Studio. An existing website can also be used.  Create a new blank view and name it “UploadFiles”. You should be able to navigate to the page using …[read more]


NLog with SQL Server and MVC 4

NLog is a great open-source logging tool that allows developers to easily and efficiently implement custom logging. Nlog can be configured to log to a number of targets, but on this tutorial we will be looking at logging to the database. First you need to add NLog to your MVC website. Bring up the Nuget package manager and search for NLog. Add the following packages: NLog NLog Schema for Intellisense NLog configuration NLog for Extended Profile This will add the necessary dlls and config files for use later. Once the installation is complete, you should see the following file at …[read more]


jQuery UI Autocomplete with jSON in MVC 4

jQueryUi has an autocomplete plugin that allows developers to turn any standard text box to turn any standard textbox to an autocomplete search box. In this case we will try to implement this in the simplest way possible using a web service as the data source. First of all, create a standard MVC 4 project. This will be used to test our functionality, however any existing website can be used for the same purpose. If you are not already referencing the jQuery and jQuery UI libraries in your _layout.cshtml, add them. You can either add them directly in your …[read more]