This documentation is archived and is not being maintained.

HttpBrowserCapabilities.JavaScript Property

.NET Framework 1.1

Gets a value indicating whether the client browser supports JavaScript.

[Visual Basic]
Public ReadOnly Property JavaScript As Boolean
[C#]
public bool JavaScript {get;}
[C++]
public: __property bool get_JavaScript();
[JScript]
public function get JavaScript() : Boolean;

Property Value

true if browser client supports JavaScript; otherwise, false. The default is false.

Remarks

If the client browser supports JavaScript but scripting is disabled through a security setting, JavaScript will return true but script will not execute on the browser.

Example

Code in the following example executes only if the client browser supports JavaScript.

[Visual Basic] 
If Request.Browser.JavaScript = True Then
   '...
End If
   

[C#] 
if (Request.Browser.JavaScript == true)
{
   //...
}
   

[C++] 
if (Request->Browser->JavaScript)
{
   //...
}
   

[JScript] 
if(Request.Browser.JavaScript){
   //...
}
   

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

HttpBrowserCapabilities Class | HttpBrowserCapabilities Members | System.Web Namespace

Show: