Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

How to write JavaScript code to check .net framework is install in client system for chrome and Firefox. Code I have written is working fine only in IE.

JavaScript Code
-------------------------------------
JavaScript
var bAgn = navigator.userAgent;       
if (bAgn.indexOf(".NET4.0E") != -1)
  document.write(" Frame work installed.");


when I am trying to execute same code in chrome or Firefox, it's not working.
Posted
Updated 2-Jan-13 23:56pm
v2
Comments
DaveAuld 3-Jan-13 5:58am    
You should never rely on the useragent to determine the status of a clients configuration. The useragent can be tweaked/emptied/custom by the user. What are you trying to achieve by determining if the client has .Net or not?

1 solution

Refer How To Check .Net Framework Version Installed[^], which says that

Please take note that that JavaScript code can be used in Firefox or Opera web browser to query their User Agent String too (but only the IE will report .Net framework version in its User Agent String).
And you will get alternate ways to detect by code if you are doing in ASP.net.
Also follow Answer - How to detect .NET framework installed in a web page (pure HTML or PHP)[^].
 
Share this answer
 
Comments
Hi @KK.Deep,

Thanks for accepting the answer.

Regards,
Tadit.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900