jHash v2.0 Released: Now with Routing Support!

1. May 2012
jHash is a small, lightweight (4kb minified / 2kb compressed) javascript library that makes it extremely easy to work with “location.hash". Version 1.0 had the ability to set / retrieve hash root values as well as “hash querystring” values. The newly released version 2.0 includes a new lightweight routing engine that facilitates an easier developer experience when building Single Page Applications. The jHash documentation contains full descriptions of the libraries methods and their usage.... [More]

JavaScript, HTML , ,

Design Patterns: Basics of Dependency Injection

13. April 2012
Dependency Injection and Inversion of Control (IoC) have become popular buzz words in the .NET development world over the last couple years. However, It seems that not very many developers really know what they are. Like most design patterns they are rather simple in idea, but the various implementations can become complex to someone new to them. Also, it seems that these two are often considered that they must go together or even mistaken as the same thing. This prompted me to write up this sho... [More]

C#, Design Patterns , ,

Awarded 2012 Microsoft MVP - Bing Maps

1. April 2012
Whether I won MVP or not I would still do what I do. My passion for technology and the pleasure of helping others it what drives me. This marks the 5th time I've been awarded Microsoft MVP, and am honored for this recognition. Thank you Microsoft! Congratulations to all April Fools MVP's; new and renewed! If you are not familiar with the Microsoft MVP Program, you can find information about it here: http://mvp.support.microsoft.com

General ,

SQLinq: Use LINQ to generate Ad-Hoc, strongly typed SQL queries

24. March 2012
SQLinq is a new library that allows ad-hoc SQL code to be generated at runtime in a strongly typed manner that allows for compile time validation of your SQL code. Why SQLinq? SQLinq is built with the core idea of simplicity and ease of use. SQLinq wont get in your way like other Data Access Layers will. SQLinq is not so much a Data Access Layer (DAL) as it is a code generation tool. Although, it’s not a code generator like others you may be used to. If you look at Entity Framework, you’ll se... [More]

C#, SQL , , , ,

Unit Testing with SqlException in .NET: Only with help from Reflection

2. March 2012
If you are writing you code to be able to easily unit test each method, and you would like to unit test situations where a SqlException exception is thrown, then you’ll definitely run into the issue of the SqlException objects constructor being marked “internal.” Members marked “internal” can be a nightmare for unit testing, and they are found all over the place in the .NET Framework. Basically you can’t call “internal” methods, constructors, fields, etc from you own code because it doesn’t resi... [More]

C#, TDD , , ,

IronJSMVC: Script ASP.NET MVC in JavaScript using IronJS

21. January 2012
Personally, I enjoy writing much of my applications using a statically typed language such as C#. However, I would really prefer to be able to write UI logic and script certain parts of my applications using a dynamic language if I could. I was thinking about this and the following question came to mind: What would it be like to write an ASP.NET MVC application entirely using JavaScript? So I thought I’d work up a prototype using IronJS (a javascript implementation for the .NET DLR.) Download... [More]

JavaScript , , ,

HTML5 IE9 Bug: SELECT box is Un-Selected using Mouse if CSS modifies position on hover

21. January 2012
I recently encountered this rather strange bug that only shows up in Internet Explorer 9 (haven’t tried 10, but likely there too,) but works just fine in IE8, Firefox, Safari and Chrome. Generally the HTML/CSS markup for an individual page within a normal web application can get pretty complex, so this bug took me a while to figure out what it was. Apperently, if you have a <SELECT> box contianed within a <TABLE> (which is done fairly often with data entry interfaces,) and you have ... [More]

HTML, JavaScript , ,

CanvasMap Prototype = HTML5 Canvas + Mapping

5. January 2012
When Microsoft released the Windows 8 Developer Preview (Sept. 2011) I was a bit annoyed that they failed to include a “native” Bing Maps control for us to build with. Instead they require you embed the Bing Maps v7 Ajax map within an IFrame to use it. There are a few issues with this that I wont get into now. So, consequentially, I decided to prototype my own map control with the intended purpose to use it with JavaScript based WinRT apps if it turned out well. Disclaimer: The code for CanvasM... [More]

Bing Maps, JavaScript , ,

2012 Bing Maps Feature Wish List

19. December 2011
The Bing Maps Silverlight control is really sweet (although it hasn’t been updated in forever) and the Ajax v7 control was a huge improvement performance wise over v6. However, the Bing Maps platform has a long way to go before I would consider it to be the mapping development platform I would hope it could someday become. Bing Maps Wish List Here’s a list of some features that I hope make their way into the Bing Maps platform for us developers to be able to utilize: 1) Bring 3D Mapping Back!... [More]

Bing Maps

ASP.NET MVC Themes: 3 different theming methods

19. November 2011
There really isn’t a single “one size fits all” solution to theming an ASP.NET MVC web application. From my experience working with the platform, there are really 3 different methods that can be used to theme your apps. Here they are in no particular order: 1. CSS Stylesheet This is the simplest and pretty much standard method that’s used to theme an ASP.NET MVC web application. Basically, you just create a different version of your sites CSS file for each “theme.” Then you include the approp... [More]

ASP.NET MVC , , ,

SQL Azure: REBUILD All Indexes in Database – Alternative to DBCC DBREINDEX

10. November 2011
Unfortunately there are some differences between SQL Server and SQL Azure. One of these differences is that SQL Azure does not support the “DBCC DBREINDEX” command. Thankfully there is an alternative you can use to rebuild the indexes within your SQL Azure databases. The alternative is to use “ALTER INDEX” instead. ALTER INDEX ALL ON TableName REBUILD Here’s an example that loops through all the tables in a database and rebuilds all their indexes: DECLARE @TableName varchar(255) DECLAR... [More]

SQL , ,

JavaScript: window.onbeforeunload Event - Show “Are you sure you want to leave this page?” Message

9. September 2011
All web developers have likely seen how inconvenient it can be for a user to edit some data in an application, then click a link/button to go on to the next task, but only to later realize that all changes made were never saved. This can pose a major problem for users, until they get it down that they need to click the “Save” button before leaving the page. Wouldn’t it be nice for the app to remind them to click the “Save” button? Everyone has seen the “Are you sure you want to leave this page?... [More]

JavaScript

Tag Editor Field using jQuery similar to StackOverflow

9. September 2011
The tag editor featured on the StackOverflow website (and all the StackExchange websites) is a real slick tag editor that makes it much nicer to enter tags than just a plain textbox. I searched a little and couldn’t find anything that works just like theirs, so I decided to build one. Download Full Source Code: jquery.selectit-0.1.zip Here’s some example usage of the tag editor: <div id='SelectBox' style='width: 350px'></div> <input id='btnClear' type='button' value='Clear... [More]

JavaScript ,

Entity Framework Tips and Tricks: Use GetObjectByKey When Querying a Single Entity

7. September 2011
I’ve been using Entity Framework a lot lately and it makes data access really nice. It’s fairly simple to use and maps all your tables to a .NET object model. However, just like any other library, it can be misused and have it’s own issues. I’ve been figuring some things out as I’ve been using it, so I thought I’d share a few tip and tricks that I’ve learned. Here’s the first one: Use “GetObjectByKey” when Querying for a Single data entity Take the following query: var person = (from p in con... [More]

C# , , ,

Mixing some Dynamic-ness with IronJS in .NET 4

24. August 2011
I recently started messing around with IronJS again, and I must say that this project is pure awesomeness! One of the first things I noticed is that when you call the “Execute” methods to run some JavaScript code it returns an “object.” Now, while this works just fine, I would prefer if it returned a “dynamic” object while running against .NET 4.0. There may be some reason that Fredrik Holmstrom (the author) decided to return an ‘object’, so I don’t mean to sound negative, but you have to admit ... [More]

JavaScript, C#, DLR , , ,

Bing Maps v7 Ajax Hacks: InfoBox Description containing Html tags

10. July 2011
For some odd reason the Bing Maps team decided to not allow HTML tags within the Description property of the InfoBox class they baked into the Bing Maps v7 Ajax control. I don’t know why they would limit it in such a way, but thankfully I have figured out a hack to override it and allow HTML tags as desired. Here’s a full sample page that adds a map with pushpin and infobox, and sets up overriding support to allow HTML tags within the infobox’s description:   <!DOCTYPE html> ... [More]

Bing Maps ,

Bing Maps v7 Ajax Hacks: Pushpin Tooltips via Html Title Attribute

10. July 2011
The Bing Maps v7 Ajax control is still a bit lacking in functionality, and good for us it’s written in JavaScript so it’s easy to extent and hack. The following hack is an “unsupported” method of adding Tooltips to Pushpins by making use of the HTML Title attribute. The Google Maps API already has a “setTitle” method on Markers to add a Tooltip to the pins plotted. Now, thanks to this hack, the same can be done using the Bing Maps v7 Ajax control. Here’s a full sample page that adds a map wi... [More]

Bing Maps ,

Bing Maps JavaScript Intellisense Helper Now Available as Nuget Package

6. April 2011
I just put out a Nuget Package to make it easier for you to include the Bing Maps Javascript Intellisense Helper within your web applications. http://nuget.org/List/Packages/BingMapsIntellisense_6

Bing Maps , ,

Awarded 2011 Microsoft MVP–Windows Live Platform

1. April 2011
I really enjoy helping others. One of my main motivations for my continued efforts in helping others build great software and implement the latest technologies is the fact that I am trying to give back to the communities that I have learned so incredibly much from over the years and continue to learn from every day. I often feel that I have learned so much more from the community than I could ever repay, so my community contributions (blogging, forums, users groups, open source projects, etc.) a... [More]

Deeper in .NET 2011 in Review with Pictures

21. March 2011
I had a great time at Deeper in .NET 2011 this past Saturday. It was a day full of geek speak about .NET, HTML5, MVVM, Silverlight, IOC, Windows Phone 7 and more! Not only were the sessions great, but it was also an awesome opportunity to network with other local developers and recruiters. A special thanks goes out to all those who helped organize and administer the event! (Too many to name and frankly I don’t want to leave any one out.) Also, thanks must be given to the sponsors and speakers. ... [More]

WI-INETA ,

New “Earthquakes in Last 7 Days” Bing Map App

14. March 2011
In recent light of the earthquakes, tsunami and huge disaster in Japan, I put together the new “Earthquakes in Last 7 Days” Bing Map App. You can try it here: “Earthquakes in Last 7 Days” Bing Map App This app pulls in the USGS feed of earthquakes of magnitude 2.5+ from the past 7 days. When ever you go to the app, it will show you the most recent earthquakes that have occurred. Here’s a screenshot showing all the earthquakes globally from the USGS feed at the time of writing this blog post: ... [More]

Step By Step: Bing Maps Silverlight and an Out Of Browser (OOB) Application

26. January 2011
I’ve received a couple questions regarding the display of the Bing Maps Silverlight control within a Silverlight Out Of Browser (OOB) application, so I decided to write up a simple step by step example of creating a basic Silverlight OOB application that displays a map. Step By Step Example Follow the below steps to create a basic Silverlight OOB application that displays a map using the Bing Maps Silverlight control within Visual Studio 2010: Step 1: Create New Project In this case, I’m ... [More]

Bing Maps, Silverlight , ,

Geomap Project - HTML Extensions for Rendering Map Displays

13. January 2011
One thing missing from HTML5 is the ability to render maps on a page. The Bing Maps and Google Maps JavaScript API’s are generally fairly simple to implement, but they could both be easier. I wrote up a small example API that allows you to add Maps, and plot data on those Maps, to an HTML page by using mostly HTML markup using a new <geomap/> tag. While this project uses JavaScript to perform the map rendering once the page loads, all you need to do to implement it is write some simple ma... [More]

HTML, Bing Maps , , ,

MvcXaml - Images from XAML within ASP.NET MVC Application

9. January 2011
It can be cumbersome using GDI+ to dynamically generate images based on data. I recently had to perform some dynamic image generation within an ASP.NET MVC application, and had the idea of using XAML to define what the image will look like. In a relatively short amount of time, including searching the web and looking at Anoop Madhusudanan’s example, I successfully put together a proper ASP.NET MVC ViewEngine to perform this task. Download MvcXaml with Samples! Basics of Usage After you regi... [More]

ASP.NET MVC ,

Technology to Watch in 2011 and Beyond

3. January 2011
While we may not find evidence of extrasolar intelligence, there is plenty of terrestrial things to keep in eye on. But then again, you never know. The below items are not numbered, as I did not want to emphasize any single item more than the others. They are all important and their advancements WILL CHANGE EVERYTHING! “Any sufficiently advanced technology is indistinguishable from magic.” – Arthur C. Clarke Advancements in Technology Touch Screens Sure, we’ve seen single touch monito... [More]

General