Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

Detecting Browser details

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Iain - 03 Aug 2007 11:28 GMT
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>
Mark Rae [MVP] - 03 Aug 2007 12:03 GMT
> 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.

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.