PP wrote:
Using JavaScript, is there a way to identify if the user machine has .NET 2.0
frame installed?
The user agent string of Internet Explorer is changed to contain e.g.
.NET CLR 2.0.50727
so with script inside of IE you could parse
navigator.userAgent
to look for that substring to check whether the .NET framework runtime
is installed:
function checkNETFramework (version) {
var pattern = new RegExp('.NET CLR ' + version);
return pattern.test(navigator.userAgent);
}
if (checkNETFramework('2.0')) { ... }
But don't expect other browsers to expose the MS .NET framework version
in the user agent string.
And there is no need to depend on client-side script to check the user
agent string, it is usually sent as a HTTP request header and that is
exposed server side in ASP.NET e.g. you could check
Request.UserAgent.IndexOf(".NET CLR " + "2.0") > -1
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/