Is there a reliable way to detect if browser enable javascript in C#?
I am trying to detect if client browser suppport jav开发者_StackOverflow社区ascript using asp.net/C# code. After searching online, I found two methods:
bool enjs=Request.Browser.JavaScript
int version=Request.Browser.EcmaScriptVersion.Major
(it says if version grater and equal to 1, the browser support javascript)
However, after testing, I found neither of them works. No matter I turned off or turned on javascript the enjs always be true, and version always equal to
Does anyone know a method could detect if browser supports javascript? I want the asp.net/c# code. Thanks.
Use javascript to change the value of hidden form field in the page's onload event. If the new value shows up on postbacks, you have javascript.
精彩评论