The simplest way I have found to detect if the .NET Framework has been installed or not is to check for the existence of the registry key "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework." You can find out what versions have been installed by enumerating the keys under the sub-key "policy." However, you are somewhat out of luck using NT4 for ASP.NET since, according to Microsoft: "ASP.NET Web applications and XML Web services can only be hosted on Windows XP Professional, Windows 2000, and Windows Server 2003." (see full details). Sorry!
This was first published in May 2004