DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Fri, 03 Aug 2007 10:28:53 -0000,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    Iain
          2    Mark Rae [MVP]


Detecting Browser details   
Hi All

Hope someone can help.

Using Delphi Borland Developer 2006, a C# Internet project.

I am attempting to detect the Browserm version etc during the Page
Load event but cannot  work out how.

Basicall I want to get the following type (see the script at the
bottom of the post ) of information and store the information in a
session variable then save to a database table if required. Is this
possible, and if so how.

Many thanks in advance for any help offered

Iain

<script type="text/javascript">
var x = navigator
document.write("CodeName=" + x.appCodeName)
document.write("<br />")
document.write("MinorVersion=" + x.appMinorVersion)
document.write("<br />")
document.write("Name=" + x.appName)
document.write("<br />")
document.write("Version=" + x.appVersion)
document.write("<br />")
document.write("CookieEnabled=" + x.cookieEnabled)
document.write("<br />")
document.write("CPUClass=" + x.cpuClass)
document.write("<br />")
document.write("OnLine=" + x.onLine)
document.write("<br />")
document.write("Platform=" + x.platform)
document.write("<br />")
document.write("UA=" + x.userAgent)
document.write("<br />")
document.write("BrowserLanguage=" + x.browserLanguage)
document.write("<br />")
document.write("SystemLanguage=" + x.systemLanguage)
document.write("<br />")
document.write("UserLanguage=" + x.userLanguage)
</script>
Date:Fri, 03 Aug 2007 10:28:53 -0000   Author:  

Re: Detecting Browser details   
"Iain"  wrote in message 
news:1186136933.589284.227350@o61g2000hsh.googlegroups.com...


> Load event but cannot  work out how.
>
> Basicall I want to get the following type (see the script at the
> bottom of the post ) of information and store the information in a
> session variable then save to a database table if required. Is this
> possible, and if so how.


Some of the information is available through 
HttpContext.Current.Request.Browser, but most isn't...

Easiest way I can think of doing this is to have an initial page (e.g. 
<root>/default.aspx) with a piece of JavaScript similar to what you already 
have, but which builds up a string of name/value pairs e.g.

<script type="text/javascript">
var x = navigator;
var navProperties;
navProperties += "appCodeName" + "" + x.appCodeName + "|";
navProperties += "appMinorVersion" + "" + x.appMinorVersion + "|";
etc...

This is then stored in a hidden field and posted to your welcome page. In 
the code behind your welcome page, you would parse and split the string.


-- 
Mark Rae
ASP.NET MVP
http://www.markrae.net
Date:Fri, 3 Aug 2007 12:03:22 +0100   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us