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: http://jhash.codeplex.com ... [More]
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:
This code defines a range input tha... [More]
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]
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:
Why is the UserAgent unreliable for detection?
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]
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]
Below are videos of two TED talks that I discovered over at TED.com. 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]
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]
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]
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]
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 2010 Community Coding Contest winners have been announced.
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 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!
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]
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.
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]
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 http://bing.com are lacking when it comes to SEO.
Below are some link... [More]
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]
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]
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]
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]
"Congratulations! We are pleased to present you with the 2010 Microsoft® MVP Award!"