Detecting Browser details

I

Iain

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>
 
M

Mark Rae [MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top