Deleting data before donating
Dec 24th
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.
IIS7 Gotcha – COM Error 80040154
Dec 16th
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 (0×80040154): 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:

IIS7 COM Gotcha
jQuery DivFlip of MVC Partial
Nov 9th
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.