This weekend I was out in the sun a lot. I think it got my brain working more than usual. On Saturday I found the power of MVC.net. I mean seriously, MVC.net will change the way I programme and I know people have harped on at me for years now, but this is, it’s finally clicked!
Learning MVC.net
If you have read my blog before you know that I am learning new stuff. I wanted to learn how to develop iPhone applications and how to create web pages that work on the iPhone. What I didn’t want to have is massive amounts of code duplication as it would become a administration nightmare in the future. This is where MVC.net and it’s routing engine comes in nicely.
MVC.net is powerful!
While reading around the blogosphere, I came upon a post by Scott Hanselman. The catchy title of Mix: Mobile Web Sites with ASP.NET MVC and the Mobile Browser Definition File got me reading it straight away. Â I will do a full post on what I did, but suffice to say here, Scott’s ViewEngine code plus a mobile.browser file from http://mdbf.codeplex.com/ makes it simple for me to create a sub-folder in my View’s folder e.g. /Views/Jobs/iPhone. Â I then duplicate views in this folder e.g. Default.aspx, and when a visitor comes to the site, the mobile.browser file helps the code tell the programmer what browser the user is coming from, and the ViewEngine given by Scott Hanselman redirects the request to the view in the /Views/Jobs/iPhone folder. Â The view here has been specially built to display properly on an iPhone. Â It looks awesome, and works well.
What makes this even more powerful, is that I can now create views specific to different mobile devices. Â When the iPad takes off, cause it will, it’s Apple and Apple have lots of fan boys – including myself, but that might change due to a change in their terms and conditions, then I will be able to create a View for each of my sections specific to the iPad…how awesome will that be!
Other updates
I have also updated the layout of http://tiny.projecttime.co.uk/ to make it easier to use when you have a lot of clients and jobs. Â I imported a database from the older version of #projecttime which had hundreds of clients and projects. Â This showed me where I was going wrong with the interface. Â I had to add in a sub navigation of each of the letters of the alphabet so you can quickly filter clients and jobs by the first letter of their names.
In Jobs I also added in a Job code field as lot of companies work with Job codes when doing invoicing – I will be adding invoicing in the coming months. Â Also to help invoicing in the future I added contact details to the Client section, so when creating a Client you can add their address, telephone and email details. Â I don’t want #projecttime to turn into a CRM system as I said that most people will have all their contacts in Outlook or some other system, but there will be some sections where I will need to add some contact information – possibly in Jobs when adding contacts from the client that you will be working with directly.
All of this was done so quickly due to the ease of how MVC.net works and the power of jQuery. Â Thanks Microsoft and Scott Guthrie for creating this system, and thanks jQuery for the amazing javascript library!


[...] This post was mentioned on Twitter by colinwiseman. colinwiseman said: #youarenotme: timesheets : tiny update again http://you.arenot.me/index.php/2010/04/11/timesheets-tiny-update-again/ [...]
Hey Colin!, Marcin and me also used MVC2.NET, MVC2 is a RC version but is good, is fast, is free and its open-source. My skype message says : [MVC2.NET-3.5 == .NET Turbo] … it will take PHP over during the next couple of years, and it will change the market as well. We (the PHP techies) have to embrace MVC2.NET. We will!
Thats freaking awesome that you said that. Both you and Marcin have been swayed by the dark side…muwahahaha.
You’re right though, the power that I can see happening in MVC2.0 is amazing. We were at Scott Guthrie’s presentation couple of weeks back on MVC2.0 at the Odeon (the Guathon) and he was showing stuff that made me cry with pleasure. I love how you can write this:
< % Html.EditForm(object) %>
or something like that, and MVC will turn that into a full edit form. Then with a couple of attributes on properties in your code, you can then tell MVC not to render things. It’s crazy simple, and crazy powerful!
So yeah I (heart) MVC.net…I maybe lusting after MVC2.0 now
(in a fully plutonic, it’s only code type of way!)
“Plutonic”? Dealing in weapons of mass destruction now, Mr Wiseman? If it was, say, platonic, I could understand, but attributing enriched uranium to a code base is a slightly worrying development in your, eh, development.
Dude my code base is pretty nuclear! Soon I shall have enough to power my new Delorean…
http://www.newsgroupdirect.com/blog/wp-content/uploads/2009/12/delorean1.jpg