Jan 2009 ASP.Net MVC Slides

Update: The Release Candidate has been released. The demo below works fine with it too.

>> Click here to download the slides and second demo. <<

Wow! We had a fantastic turn-out last night, interest in MVC must high!  Not having presented for almost a year  I tried not to publicize the the talk; but still instead of the expected twenty to thirty people there must have been close to a hundred and we had to expand the room! Couple this with the Microsoft building now almost impossible to find with that road closure flummoxing us coming from the south-side – who knows how many found Old Roswell gone and went back home at that point. For those that missed last night this talk will be repeated at all local code camps that happen in the next few months, the Atlanta one is in March and 2009 details will soon appear at atlantacodecamp.com.

Obviously that presentation covered only some of the very basics and there is a lot more to working with MVC. Watch this space for more MVC tips and if people request it, I’ll put together a deeper presentation for Code Camps etc.

Also, I was not kidding about the free presentation/ training at your company. Totally free, no creepy sales people will call afterwards either – it will keep my hand in while taking a few months out from real work and with luck one of them might lead to my next gig (which will use MVC).  So if you have at three or more devs drop me a line via the ‘Email Me’ page on this blog – don’t worry if you are a small or large shop, I just want to spread the word and try to ensure there are a selection of MVC Contracts out there when I get bored of goofing off 🙂

Posted in ASP.Net MVC | Comments Off on Jan 2009 ASP.Net MVC Slides

TurboTax vs TaxCut 2008

TurboTax has been wonderful over the years but the 2008 price totally made me baulk. An eye popping $229.80 this year for my needs:

$49.95 Premier inc Rental Properties + $34.95 Per State
$109.95 Business including S Corporations

H&R Block Home & Business 2008 promises the same functionality for $67.96 (Google for a discount coupon code). This was enough of a saving to try it, worst case I waste a few hours and buy TurboTax.

Since the IRS have not finalized rules for 2008 a few areas are not yet available including what seemed to be almost all the s-corp filing. Still I entered our W2s, a dummy 1099 and all the details on my rental properties with no issue. Everything was as easy as it was with TurboTax. There are still all the detailed sections to ensure you are aware of what can be deducted without reading 17,000 pages of IRS publications or trying to get a comptent accountant to talk to you. As for problems so far,  non are worth mentioning being just very minor niggles. Before buying I read online that H&R does not even let one print PDFs – well I just saved my 2008 draft with no problem (File -> Save As PDF…).

Here are a few samples screens, please don’t laugh at the repairs on the rental – it has barely an issue for five years and last year seemingly everything broke:

Looks a lot like TurboTax right? Go ahead save the money, you’ll feel amost right at home

As with Turbo Tax this Rental screen  maps straight to the tax form field – ah this is soo simple 🙂

Posted in Other | Comments Off on TurboTax vs TaxCut 2008

Deleting data before donating

This was so easy I felt obliged to blog it. Under our house rule ‘not used it in a year, so it has to go’, our old P4 laptop is being donated. It held old tax records, Microsoft Money files etc which had to be deleted first.

One free and simple technique is Boot and Nuke. I download the small ISO and used this free ISO burning tool to burn a CD.

The laptop then booted from the CD into a Linux program which looks similar to below once running. I choose the default and it took about two hours to delete a 70GB 7400 rpm hard disk with a DOD Short (three pass) technique:

Finally another 30 minutes using Averatec’s media recovery discs and it is now ready for someone else to enjoy.

Posted in Technology | Comments Off on Deleting data before donating

IIS7 Gotcha – COM Error 80040154

We have all seen the 80040154 COM error. Normally the solution is to run regsvr32 on the com dll so it is registered on the machine.

“System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {D1CB0D81-7D2B-4064-9AC7-D0D88DEC3D16} failed due to the following error: 80040154.”

Of course regsvr32 was the first thing I did, but the error still happened in the ASP.Net MVC project on IIS7/ Server 2008. Using regedit.exe verified the dll was registered, so I ran the NUnit tests… same error! The solution is to permit the IIS7 App Pool to run 32 bit code as shown below:

Posted in Uncategorized | Comments Off on IIS7 Gotcha – COM Error 80040154

jQuery DivFlip of MVC Partial

So you have a Partial in a div and would like to flip out the html contents with new results from just the partial… To para-phrase Obi-Wan ‘this is the JavaScript you are looking for’:

function Save() {
var data = $(‘#PartialData’).serialize();
$.post(‘SavePartial’, data, function(result) {
if (result == “success”) {
$(“#DivFlipThis”).load(“ProductUserControl”);
}
else {
alert(result);
}
});
}

It uses jQuery to serialize form data, then an Ajax post sends the data to a controller action which auto-binds it to the model. All in all there are very few lines of code. If anyone needs to see the controller actions they can be found in this tiny sample project DivFlipExample.zip (click to download). It runs stand-alone and needs no database so is MVC noob safe :)

For the projects that pay my salary (high traffic public facing websites) we have a more sophisticated technique using JSON to read a .Net class graph of errors, success message etc passed from actions to the JavaScript. The JavaScript then does a divflip, redirect to next action, shows success or error messages as applicable. It is very simple too.

So, to the MVC experts out there: Am I missing something? RoR does this kind of thing auto-magically (so our RoR team says). For hours I searched Google on how to refresh an MVC partial without doing a whole page refresh. There were many people asking the same question and lots of people like my friend Rusty Zarse becoming very frustrated, but no-one had an answer that helped us. All the demos I used to learn MVC (MVCNorthwind, MVC Commerce, MvcMembership, Suteki, MVC Storefront) need full post-backs for anything semi-significant.

Posted in Uncategorized | Tagged | Comments Off on jQuery DivFlip of MVC Partial

Google’s shiney new Browser

Chrome is out, download it here: http://www.google.com/chrome. I know the title post was a little obvious, a quick web-search shows a stack of hits for it already 🙁

Chrome is built on webkit and has worked fine for me on all my favorite sites so far, interesting tid-bits:

  • Task Manger shows each tab is a separate process – for better stability one assumes
  • Love my new desktop shortcuts to gmail, hotmail etc 🙂
  • The new tab option shows screenshots of favorite pages – cool
  • Starts-up fast, renders fast 🙂
  • Username/ passwords were sucked out of Firefix – creepy
  • It evilly dropped a shortcut into my quick launch bar, grrr

So it looks like us web-devs will soon have three mainstream browsers to test for 🙂 All the more reason for everyone to start using JQuery etc.

Posted in Technology | Comments Off on Google’s shiney new Browser