Chris Pietschmann

husband, father, hacker, entrepreneur, futurist, innovator, autodidact


jHash: Easily Manage Browser History / window.location.hash

When building Ajax-based web applications it can be difficult to get the web browsers back and forward buttons to work appropriately for each client-side state change. I recently published the new jHash library that can help alleviate this issue. Put simply: jHash allows you to easily be notified when the “window.location.hash” changes. It also allows you to easily store/retrieve values from the hash in a similar fashion to server-side query string values. Download: ... [More]

HTML5 Day 6: New Range Input Type <input type=range />

Some times a Range slider is the appropriate UI tool to allow a user to select a number within a given range. HTML5 adds such an element with it’s new “range” input type. Display in Modern Browsers In the above screenshot shows an example of the <input type=range/> element as it is rendered in the Opera web browser. Here’s the code for the range input shown: <input type=range min=0 max=100 value=25 step=5 /> This code defines a range input tha... [More]

HTML5 Day 5: New Date Input Type <input type=date />

Date is one of the new, and much needed, input types added in HTML5. This has been added as a replacement of using a text box for the input of dates. Below is a screenshot of the custom UI that the Opera web browser automatically implements for this new input type. Display in Modern Browsers This is a screenshot of the Opera web browser’s UI for the date input field. The actual display of this field is handled by the web browser and will vary in each browser and device the page is being v... [More]

HTML5 Day 4: Add Drop Down Menu to ASP.NET MVC HTML5 Template using CSS and jQuery

Today I was playing around with using jQuery to create a drop down menu. I thought I’d share an example of adding a drop down menu to the new ASP.NET MVC HTML5 Template that I created on Day 2. Before we begin, you’ll need to create a new site using the code from Day 2. You can either copy/paste the code from the article, or download the full source code. You’ll find the download link at the bottom of the post for Day 2. Here’s a screenshot of the finished dropdown menu: ... [More]

HTML5 Day 3: Detecting HTML5 Support via JavaScript

On Day 1, I covered exactly what HTML5 is and what’s necessary to convince older web browsers to render/style the new tags properly. Once you told the browser how to style the element, it still wont show special UI for the user. The good news is that you can “patch” the browser using JavaScript to enable such functionality. In this post we’ll discuss how to detect if a certain feature is supported by the browser or not. Why is the UserAgent unreliable for detection? Mozil... [More]

HTML5 Day 2: Upgrade ASP.NET MVC 2 Site Template to HTML5

Since HTML5 can be used in older browsers with some helper scripts, as covered in Day 1, I thought I’d use what I’ve learned to convert the default ASP.NET MVC 2 site template to HTML5. Convert Default ASP.NET MVC Site Template to HTML5 First, add the helper scripts, mentioned in Day 1, to the Site.Master and convert all magical DIVs over to “header”, “section”, “nav” and “footer” tags. Don’t worry about copy/paste, a download lin... [More]

HTML5 Day 1: New tags work in older browsers? Awesome!

I recently decided to really dig into HTML5 to see what it’s all about. After all, the web (err... tubes) is full of talk about how the new HTML5 Canvas element will bring an end to both Silverlight and Flash. In reality HTML5 is much more than just the Canvas element. In fact, HTML5 brings with it a large list of enhancements, including 28 new elements and form controls that do client-side data validation for you! Specification Doc or Book? Instead of reading the enormous HTML5 Specificat... [More]

2 Interesting TED Talks on The Truth About Plastic

Below are videos of two TED talks that I discovered over at They talk about how bad plastic is for the environment, the earth, for us in the end. One disturbing thing that's mentioned is that plastic does break down into smaller pieces over time, but plastic is always plastic, is always plastic. It never truly breaks down to a point where the environment can use if for something other than pollution. Dianna Cohen: Tough truths about plastic pollution Capt. Charles Moore on the seas of... [More]

Silverlight: Modify MEF to load plugins from DLL and XAP files

I’m using MEF in a new project, and the limitation that I’ve found in using MEF with Silverlight is that it only supports downloading and loading plugins/assemblies from XAP files. What I would really like to do is support plugins that are compiled into either individual DLL’s or more complex plugins within a XAP. Update: I have also posted this to the Issue Tracker on the MEF CodePlex site. Why individual DLL’s? The really answer to this is flexibility. I don’t think they creators of MEF mad... [More]

Silverlight: Embed IronRuby within XAML Part 2

In the previous post I explored the possibility of embedding IronRuby / DLR Script within XAML using both an IValueConverter and Custom UserControl. I spent a little more time experimenting with the DLRScriptUserControl I posted, and came up with some small modifications to it that allow UI event handlers to be wired up using a DLR language (such as IronRuby. Loading Assemblies Into the ScriptEngine.Runtime Context Something nice with how the ScriptEngine class allows you to execute a script o... [More]

Silverlight: Embed IronRuby/DLR Scripting within XAML using IValueConverter and Custom UserControl

After I wrote the “Intro to IronRuby/DLR Scripting in C# Silverlight 4 Application” post, I came across an interesting series on embedding DLR scripts in XAML with WPF. This is an interesting series, although the code doesn’t run in Silverlight, due to the fact that Silverlight is only a subset of WPF and doesn’t support the System.Windows.Markup.MarkupExtension class. I test out a couple things in Silverlight, and I was able to get similar DLR scripting functionality working under Silverlight u... [More]

Intro to IronRuby/DLR Scripting in C# Silverlight 4 Application

I’ve been working lately on figuring out how to add DLR scripting support to a Silverlight 4 application I’ve been working on. The idea is to give it a plugin style architecture, with the plugins being written in a DLR language; currently focusing on IronRuby. I originally searched how to do this, but couldn’t find any recent articles that discuss Silverlight 4. Also, most articles out don’t target Silverlight and more of them discuss IronPython and not IronRuby, even though the DLR stuff is the... [More]

The Future of Location: You Haven't Seen Nothing Yet!

The popularity of location aware devices and software has been on the rise for the last five years, since Google Maps and Microsoft Virtual Earth (now Bing Maps) were initially released. Surprisingly, however, the utilization and adoption of geo-location and mapping haven't been as rapid as I had speculated back in 2005. Today there are all kinds of location based applications and services popping up. Paper Maps and Expensive Software Prior to 2005 the existence of maps were mostly on paper. Y... [More]

Today (8/31) is last day to enter 2010 Community Coding Contest for chance to win an MSDN Ultimate Subscription!

Today is the last day to enter the 2010 Community Coding Contest for a chance to win an MSDN Ultimate Subscription plus a total of approximately $20,719 worth of prizes!! All you need to do is write some source code to do something, and enter it into the contest. Who know, you could be one of the winners!

Use New Bing Maps Road Imagery In Silverlight Map Control (Unofficially and Unsupported)

Recently the consumer facing Bing Maps site changed the map imagery that is displayed for the Road map mode. This map imagery has not been officially made available for Bing Maps for Enterprise developers to use within their applications. The imagery is only officially available to the Bing Maps consumer website. Unofficially, you can still access the imagery if you know the URL format to get it. Below is an example of using the URL format for the new imagery to display it within the Bing Maps S... [More]

Loading Microsoft CDN Hosted OpenStreetMap Imagery in Silverlight Bing Maps Control

Recently a new Bing Maps App for OpenStreetMap (OSM) was released. This new feature of the Bing Maps consumer facing website is hosting the OpenStreetMap imagery using the Azure CDN, rather than relying on OpenStreetMap’s server. There has been some question as to whether developers can use the Microsoft hosted OpenStreetMap imagery within their own applications. I have not seen anything official from Microsoft on this, so I assume that doing this is against their terms of use. You assume... [More]

Microsoft BizSpark: My new startup is enrolled, but was denied twice before this blog post

Update Wednesday, Dec. 1, 2010: I have had a few people contact me about getting denied enrollment in the BizSpark program. Most of these people are trying to enroll a CONSULTING company; which is NOT what BizSpark is for. BizSpark is for companies that are “Actively engaged in development of a software-based product or online service that will form a core piece of its current or intended business.” That means, if you want to enroll in BizSpark, that you must be developing a product ... [More]

Bing Community Site Not SEO Optimized

Since Bing is a search (ahem, I mean “decision”) engine, I would assume that the rest of the website, other than the search, would be SEO optimized (Search Engine Optimization). It hosts blogs and forums, and I would assume Microsoft would want them to be indexed by Google and Yahoo. After all, more traffic to the Bing site should be a good thing. However, it seems that the “Bing Community” sections of are lacking when it comes to SEO. Below are some link... [More]

Silverlight Bing Maps: Draw Circle Around a Latitude/Longitude Location

Over 2 years ago I posted an example of how to draw circles on the Bing Maps JavaScript control. I thought it was about time to update that post to demonstrate how to do this using the Bing Maps Silverlight control. This is basically a C# port of the original JavaScript code. Sometimes this can be really useful, but it isn’t built into the Sivleright Bing Maps Control. So you need to implement it yourself in order to do it. However, instead of writing from scratch, feel free to copy the c... [More]

Display Google Maps Imagery using Bing Maps Silverlight Control

I’ve gotten a couple emails asking how to show Google Maps imagery using the Bing Maps Silverlight Control. I previously post how to display OpenStreetMaps and Yahoo maps imagery using the control, but is it possible to show Google Maps imagery too?? Yes, absolutely; well technically, but the Google Maps Terms of Use does prohibit it. Actually, the Google Maps Terms of Use prohibits the direct access of the map tile images, and does not specifically prohibit using them with the Bing Maps S... [More]

Resizing and Auto-Scaling Pushpin in Bing Maps Silverlight

Plotting pushpins on the Bing Maps Silverlight control is really simple when using the Pushpin control that comes with the control. But, what if you want to change the size of the Pushpin? It doesn't work to just change the Pushpin.Height and Pushpin.Width properties. This is actually because those properties pertain to the controls Content property. So, how exactly do you go about changing the size of the Pushpin if the Height and Width properties don't work? Use ScaleTransform to Resize Pushp... [More]

Draggable Pushpins using Bing Maps Silverlight Control

Using a map to visualize data within an application is great, but you must first get the location of the data to be displayed. If you have the address you can geocode it using the Bing Maps Web Services, but "What if you can't geocode it?" Or, "What if the geocoding can't find the address?" Well, if your user knows where the location is, then you can have them point it out by clicking on the map. Creating Pushpins in response to a users click is nice, but wouldn't it be even ... [More]

Boycott BP, Save the Planet!

I've decided to boycott BP until the Oil Spill in the Guld of Mexico is fixed/cleaned up! If you remember the oil spill in Alaska back in the '80's then you remember all the pictures/videos of all the animals killed by being covered in oil. The same thing is happening today in the Gulf of Mexico with the oil drilling blowout that has been spewing oil into the ocean for a month now. Oil does not occur naturaling in the ocean or on land. As a result animals can not breath or fly when covered in o... [More]

Awarded 2010 Microsoft MVP - Windows Live Platform

"Congratulations! We are pleased to present you with the 2010 Microsoft® MVP Award!" I'm happy to announce that I've been awarded the Microsoft MVP award for the third year in a row. Just like last year, I've been awarded within the "Windows Live Platform" category. The "Windows Live Platform" category includes the Bing Maps SDK (both JavaScript and Silverlight Map Controls) which is the product/technology that I work with and help out others with the most in this category. Congratulation... [More]