How To Find Out If Browser Supports JavaScript?
To find out if visitor's web browser supports JavaScript, use this code:
[ C# ]
if(Request.Browser.JavaScript)
{
//
Browser supports JavaScript
}
else
{
//
JavaScript is not supported
}
[ VB.NET ]
If
Request.Browser.JavaScript Then
' Browser supports JavaScript
Else
' JavaScript is not supported
End If
Note that web site visitor can disable JavaScript in browser. Request.Browser.JavaScript just finds if JavaScript is supported, not is it enabled. To see how to find out is JavaScript enabled see How To Check Is JavaScript Enabled tip.
Related articles:
1. Cascaded Style Sheets (CSS) in ASP.NET Web applications
2. Unlimited Income Potential
Copyright © 2002-2008 Bean Software. All rights reserved.