Here's a class that I found in client-side Microsoft AJAX library for browser detection. It's Sys.Browser.Agent. For a while, it wasn't documenated anywhere in the Microsoft on-line documentation, but it must have just appeared recently at:
http://msdn.microsoft.com/en-us/library/cc679064.aspx
One example of how this class can be used:
if (Sys.Browser.agent == Sys.Browser.InternetExplorer)
{
alert("Display this message for IE visitors");
}
For Sys.Browser.agent, the four values it can return are:
- Sys.Browser.InternetExplorer
- Sys.Browser.Firefox
- Sys.Browser.Safari
- Sys.Browser.Opera