Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Checking if Javascript is enabled

Hi,

It would be great if someone could provide me with a solution to my problem. I want to check if Javascript is enabled in client browser using C#. How can I make this possible.

"Request.Browser.Javascript" will not do any help as it only tells if the browser "supports" Javasccript or not. I need to check if the Javascript is enabled or disabled by the browser's security settings.

Thanks & Regards,
Frenz
[446 byte] By [thefrenzybug] at [2007-11-11 10:24:04]
# 1 Re: Checking if Javascript is enabled
I don't think it's possible to determine Javascript status (which is a client-side setting) from C# (which runs on the server). The only way I know to determine whether Javascript is enabled is with Javascript: http://www.google.com/search?q=detect+javascript .

You could include a startup script on your page which submits an HTML form with a hidden field named "javascript_enabled". Then in your server-side code, check for Request.Form("javascript_enabled").
Phil Weber at 2007-11-11 23:11:50 >