Posted by: Matthew | February 6, 2010

ASP.NET MVC 2 R2 Released

So release candidate 2 (RC2) has been released. Most importantly from my point of view it fixes the breaking issue I had with RC1. From the release notes:

The GetValue method of the FormCollection class now allows empty string values.

Good on the MVC team for getting a quick turnaround on this and other bugs – it was only a month ago (Jan 4) that the RC1 was released.

Download: ASP.NET MVC R2

Posted by: Matthew | February 5, 2010

Acer easyStore Server

Most small businesses have more than one computer, but don’t have a particularly great backup regime – mainly because the server is just a normal desktop machine running Windows Small Business Server (if you’re lucky). But what if the hard drive fails on server? Can I recover my data (and how long will it take)?

I faced this problem and was looking to use a HP MediaSmart Home Server, but unfortunately they are not sold in New Zealand. The good news is that the Acer Aspire easyStore AH340-UA230N is available in NZ and I can only rave about it now we have one!

It has four hot-swappable hard drive bays, a bundled 1TB hard drive (with Windows Home Server pre-installed), 2GB of RAM, one external Serial ATA port, four USB ports, and Gigabit Ethernet. Basically, you’re not going to outgrow it anytime soon!

Note: Most online retailer advertisements seem to all say that it comes with 1Gb of RAM, but I think this is some sort of transcription error as it definitely has 2Gb!

So what’s so good about it? Apart from the price (< $1,000 NZD), you get a very able server. It can be setup to automatically wake-up your computers and do a full system backup every night (and then put them to sleep again of course). If a machine dies or you need to do a full system restore, you get a recovery disk that you can use to get back and running using the backups held on the server. With more disk drives added (USB or in the hot-swap drives) you can setup simple mirroring of the data to protect against a hard-drive failure on the server - if one drive fails, the other drive(s) will still have a copy.

They are some of the features of the Windows Home Server software, but what I like about the Acer is that it is very quiet and quick! It’s only light-weight hardware really (similar technology to a Netbook), but so far at least, it has run everything thrown at it without clocking up more than 40% on the CPU.

If you’re interested (and in NZ) Global PC, Ascent and other online retailers have stock.

Posted by: Matthew | January 25, 2010

Warning: ASP.NET MVC RC FormCollection bug

UPDATE: This post refers to ASP.NET MVC 2 R1. The R2 release on 4th Feb 2010 fixed the issue.

I started to update an ASP.NET MVC 1.0 application to the new MVC 2.0 RC but will now put off that migration for now – I’ll wait for the RTM which should fix this.

The problem is to do with the FormCollection object throwing an ArgumentException (“Value cannot be null or empty”) when calling TryUpdateModel from within your controller:

at System.Web.Mvc.FormCollection.GetValue(String name) 
at System.Web.Mvc.DefaultModelBinder.BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) 
at System.Web.Mvc.Controller.TryUpdateModel[TModel](TModel model, String prefix, String[] includeProperties, String[] excludeProperties, IValueProvider valueProvider) 
at System.Web.Mvc.Controller.TryUpdateModel[TModel](TModel model, IValueProvider valueProvider) 

This is apparently a known issue with the RC release and should be fixed in the next release. The project I am working on is fairly sizable and with the many uses of FormCollection, a lot of runtime errors have been created!

One suggested solution is to download the MVC source code and make a fix (hack?) to by-pass the issue. However, I’d rather stay on the main MVC branch and just wait for the RTM.

Posted by: Matthew | January 22, 2010

IE8 Developer Tools are built in

The developer tools for older versions of Internet Explorer were a separate install. With Internet Explorer 8 (IE8), the tools are built in. To access it, open them from the Tools menu or hit F12.

Apart from the tools we’re used to, here a couple new ones:

  • Javascript debugging works! There is also the console window (which the likes of FireFox has had for a while), allowing you to print trace information from your javascript code. This is much better than using alert boxes!
  • There is now a Profiler as well, allowing you to see function call times as well as examine the call tree. Very useful for building AJAX based sites.
  • You can test Internet Explorer 7 (IE7) compatibility. The tool allow you to change the Browser Mode and Document Mode between IE7, 8 and Quirks mode, so no need to have a VM just to work with IE7. For final QA testing however, I’d recommend using a real IE7 version.
Posted by: Matthew | January 17, 2010

Where’s the best place to do business?

NZ of course, but then we would say that wouldn’t we!

Every year the World Bank releases a report detailing the results of its survey and for 2010, the Doing Business 2010 Survey showed that New Zealand held its No. 2 spot for another year:

  1. Singapore
  2. New Zealand
  3. Hong Kong, China
  4. United States
  5. United Kingdom
  6. Denmark
  7. Ireland
  8. Canada
  9. Australia
  10. Norway 

The survey deals with a few key indicators, the important ones being ease of starting a business, employing workers, getting credit, paying taxes, enforcing contracts and protecting investors. According to Minister for Small Business Clayton Cosgrove it takes an average of 13.4 days to setup a new business, yet in New Zealand, it is one hour! That is ridiculously quick!

It is no wonder that New Zealand has so many small businesses. If you have the idea for a product or service, then there really isn’t a better place to do it.

Posted by: Matthew | July 7, 2009

Trade Me advertising … why?

Trade Me has recently updated its design, which on the whole is pretty good. However, they have also added in third party, graphical advertising. The site always stood out above the rest (the likes of eBay for example) for its clean appearance and no-clutter approach. I can’t help but think … why add the ugly advertising? Looking more like eBay is not a good thing.

Ok, yes, there is the fact that there is a lot of traffic in NZ going to these pages on a daily basis, so there is the potential to serve up a lot of impressions and demand a premium for it. However, TradeMe has a very sound financial model – it makes money and it makes it very well! It’s not like they needed to do it to increase revenue. I suspect that FairFax Media will have pushed this, opening up TradeMe as a new target for their existing customers who already advertise with them.

Will people really care? Probably not, but I’ve lost a bit of respect for them going down this path.

Posted by: Matthew | April 13, 2009

IE8 – Is your site prepared?

Internet Explorer 8 (IE8) is set to be part of Windows Update in the coming weeks. For most people, that means an automatic upgrade from Internet Explorer 7 (IE7), probably not really noticing much difference.

So what’s to be prepared about? IE8 is more  ‘standards compliant’ than previous versions, meaning that your website may not look or even work exactly as you intend in the new browser! To update a web-site’s design to be standards compliant can be time consuming, especially seen as you may have only just got through updating to support IE7!!

Microsoft thought about this and so offers the ability to select a version of internet explorer that your site supports.

By default, the browser will be in “Internet Explorer 8 Standards” mode. For non-compatible sites, users will see a broken page icon in the address bar. Clicking on this will allow them to change the compatibility to Internet Explorer 7, for example. You don’t want your site visitors to have to do this, so as a site owner, you can specify what you support.

This is done with a meta tag, in the head of your web pages. The following will set a page to render in IE8, the same as it would in IE7:

<meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE7″>

That’s it!

Full details on other possible document compatibility values can be found at MSDN – Defining Document Compatibility

The Internet Explorer 8 Readiness Toolkit also highlights other features to be aware of as a developer. It makes interesting reading.

Posted by: Matthew | March 25, 2009

Feed Url Change

The feed url for this blog has now changed to

Redirects for feed readers should happen automatically, but just in case, you should update your settings.

Posted by: Matthew | March 19, 2009

Internet Explorer 8 Released

It must just be that time of year for software releases! Download from here. Just be aware that you will need to restart your computer as part of the install, which just goes to show how integrated the browser is in the O/S  (although Windows 7 is set to change that).

Just what a web developer needs – another browser to support :)

Posted by: Matthew | March 18, 2009

ASP.NET MVC 1.0 Released

ASP.NET MVC has reached RTM! I was kind of expecting Scott Guthrie to announce the final release, but instead it was only a small news item on the ASP.NET  homepage!

It has been a long time in Beta and as such I have stayed away from it until the last couple of weeks. There are enough new products released from Microsoft to keep me busy without getting bogged down in beta’s!

So in the last couple of weeks I have been learning ASP.NET MVC after discovering that the final release was imminent and I have to admit that I am very impressed. The first and foremost difference would be that there is no longer the same postback lifecycle and no ViewState, which means pages are very fast (yay)! The level of control you have over the final HTML is akin to the old days of classic ASP or PHP, but still with all the .NET goodies to make life easier. After spending so long in Web Forms, it is quite strange (but a nice strange) to look at the HTML source and see plain, concise markup.

I’ve found the best learning source to be the tutorials provided on the official ASP.NET MVC site and also the first chapter of the new Wrox book which is available for free from Scott Guthrie. As with everything there are no shortcuts and there is a lot to learn, but if you are comfortable with the web platform in general, then the learning curve is not that steep at all.

To learn something well you need to create a sample project.  I always create a simple task management tool so that I get a nice comparison between technologies. What I found was that to AJAX-enable the site was a lot more straight forward than using the Web Forms approach – the end result was cleaner and the whole MVC approach leans itself totally to the AJAX approach.

All in all, well worth learning.

Older Posts »



Get every new post delivered to your Inbox.