Check Client Browser Type

  • Thread starter Thread starter Craig G
  • Start date Start date
C

Craig G

is there a way to distinguish whether a client is using IE or Netscape?

is there some sorta check i can run on the Page_Load event? or where would
be the best place to do this?

Cheers,
Craig
 
Pulled from 4guys web site
<script language="VB" runat="server">
Sub Page_Load(sender as Object, e as EventArgs)
ltlBrowserName.Text = Request.Browser.Type & ", " &
Request.Browser.Platform

ltlAllData.Text = "Type = " & Request.Browser.Type & "<br>"
ltlAllData.Text &= "Name = " & Request.Browser.Browser & "<br>"
ltlAllData.Text &= "Version = " & Request.Browser.Version & "<br>"
ltlAllData.Text &= "Major Version = " & Request.Browser.MajorVersion &
"<br>"
ltlAllData.Text &= "Minor Version = " & Request.Browser.MinorVersion &
"<br>"
ltlAllData.Text &= "Platform = " & Request.Browser.Platform & "<br>"
ltlAllData.Text &= "Is Beta = " & Request.Browser.Beta & "<br>"
ltlAllData.Text &= "Is Crawler = " & Request.Browser.Crawler & "<br>"
ltlAllData.Text &= "Is AOL = " & Request.Browser.AOL & "<br>"
ltlAllData.Text &= "Is Win16 = " & Request.Browser.Win16 & "<br>"
ltlAllData.Text &= "Is Win32 = " & Request.Browser.Win32 & "<br>"
ltlAllData.Text &= "Supports Frames = " & Request.Browser.Frames &
"<br>"
ltlAllData.Text &= "Supports Tables = " & Request.Browser.Tables &
"<br>"
ltlAllData.Text &= "Supports Cookies = " & Request.Browser.Cookies &
"<br>"
ltlAllData.Text &= "Supports VB Script = " & Request.Browser.VBScript &
"<br>"
ltlAllData.Text &= "Supports JavaScript = " & Request.Browser.JavaScript
& "<br>"
ltlAllData.Text &= "Supports Java Applets = " &
Request.Browser.JavaApplets & "<br>"
ltlAllData.Text &= "CDF = " & Request.Browser.CDF & "<br>"
End Sub
</script>

Your browser is: <asp:literal id="ltlBrowserName" runat="server" />
<p>
<b><u>Here is your browser's information:</u></b><br />
<asp:literal runat="server" id="ltlAllData" />
--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director
 
Back
Top