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

How can I detect that javaScript is enabled or disabled in browser at Server side ?
I searched in google and found the code below.

HttpBrowserCapabilities httpBrowser = Request.Browser;

bool enableJavascript = httpBrowser.JavaScript; // return true if Javascript enabled in client Browser

But this code is not working.
httpBrowser.JavaScript always returns true.

Please help.
StianSandberg 13-Aug-12 8:44am    
httpBrowser.JavaScript tells you if the browser supports javascript, not if it's enabled. The only way to tell if javascript is enabled is to write some javascript and check if the browser cares.
Yes you are right...

This variale merely detects if a browser is capable of running javascript and not if it is turned off or on.

Heres my solution to the problem :
How to Detect JavaScript Status on the Client Browser using Script Manager[^]

Here is a fixed demo project that resolves issues other users experienced:
Detect Javascript status of browser using Form Submit[^]

Should you have any questions please let me know.

Also a quick FYI : This solution works on all browsers.
Share this answer
bhagirathimfs 13-Aug-12 8:30am    
Link Given by you is not present...

Please improve your solution.
L Viljoen 13-Aug-12 8:40am    
Sorry that link was deleted so i only have access to it

I updated the amin article waiting for approval check the zip file at the top labeled "updated easy soution"

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