Wednesday, 25 May 2005


OK, this is a super-basic one for the command prompt - to get a recursive listing of subdirectories
C:\My Folder\>dir /s /ad /b > output.txt

back to work...

Wednesday, 11 May 2005

Debugging 'old school'

This post about Script Debugging in IE prompted me to create my own little collection of links on debugging, since I find myself currently working on a project that uses 'old school' ASP and SQL written outside VisualStudio...

Most useful is this detailed instructions document [.DOC] (on gotdotnet) or this short doc.

Then there's the lower-level stuff:
Fiddler for IE allows you to record, monitor, replay and otherwise manipulate the HTTP traffic between IE and web servers.

And these IE DOM inspectors can help to debug client-side issues by letting you view IE's understanding of the Document Object Model it has rendered.

Of course Firefox already provides features and/or extensions to do these things and more!

While we're on the subject of debugging, here's a tip for SQL Debugging after XP SP2.

Tuesday, 10 May 2005

About Cassini

If you ever installed Web Matrix (0.5 or 0.6 - it will never make version 1...)
you will already know what Cassini is... a lightweight C# web server that enables ASP.NET applications to be run without IIS.

MSDN explains Client-side Hosting with Cassini and how Cassini is used in MS-CRM.

"What use is that?", you ask... well despite the fact that it appears to be just a cute open source project, Microsoft has implemented it (well, some form of it) in Visual Studio 2005 as the primary way for developers to run ASP.NET applications without having to install IIS.

You can also use it, as Scott Hanselman has, to cobble together an NUnit ASP.NET tester using Cassini...

FYI, the name "Cassini" sprung from the code name for Web Matrix (which was "Saturn")... Cassini is of course on of Saturn's moons. More code-names decoded here.

Monday, 9 May 2005

More on Ajax

Although it hasn't taken the ASP.NET world by storm (yet), the term Ajax (and the underlying javascript-xml technology) is certainly being discussed more frequently as a viable design option. Whereas previously javascript might have been ignored in favour of Validation Controls (and the occasional pop-up window), Ajax (along with 'implementations' in Gmail, Maps.Google, etc) seems to have elevated the concept of dynamic apps into acceptability.

Since the same idea will be part of ASP.NET 2.0 (Script Callback) it kinda makes sense; but thankfully you don't have to wait until then to give it a try, as quite a few resources are appearing to get you using it now:

Have fun

Sunday, 1 May 2005

Agile and Database Design

One of the least-often-mentioned aspects of Agile Development (IMO) are the challenges involved in database change management, described in Martin Fowler's
Evolutionary Database Design.

Martin states "One of the most valuable pieces of automation is a simple set of scripts for common database tasks" - but I'm not so sure that there is a simple way to accomplish all that in a foolproof manner.

It's definitely do-able in a team of disciplined developers with good SQL knowledge, experience and dedication to writing DDL, DML and understanding when they're making a destructive change. But what about teams of different skill levels (particularly in SQL), very large databases where mulitple delta-changes, when applied, will take HOURS to run (ie. longer than a maintenance window), etc...?

Not that I have a solution right now - but why isn't it a more visible "problem" - what is everyone doing to solve this problem - manual processes?????

[EDIT 9-May-05] Peter Hancock's Continuous Database Integration article describes a novel, NAnt-based approach; but it still requires a lot of 'thought' to ensure it always works...
[EDIT 15-May-05] Unit Testing the Data Access Layer covers the 'related' issue of how to test the database...

Issues with dynamically-added ASCX

Explaining to someone why dynamically added Controls (or DataGrid columns, for that matter) can't be accessed after postback can be difficult, requiring understanding of the entire page lifecycle, the difference between the 'declarative' Control-tree and the 'run-time' one, how statelessness affects the two and why Viewstate doesn't solve the problem.

Depending on what you're trying to do, there are various workarounds including accessing the Request.Form collection directly to retrieve inputs, without accessing 'the control'; however this can be fraught with INamingContainer-induced control-name issues (see Scott Watermasysk's Implementing Dynamic ItemTemplates).

This blog on Adding controls to ASP.NET page at runtime and the Dynamically Created Controls in ASP.NET helps show the correct approach - re-adding the controls to the page before accessing them.

The MSDN page An Extensive Examination of User Controls - How User Controls Are Processed also offers some useful insight, as does the Control Execution Lifecycle

IMO every ASP.NET developer should understand and be able to describe this solution, even if they can't recite the implementation specifics without a quick Google!