473,799 Members | 3,442 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Detecting the browser once IE7 comes out

I want to make sure I am doing a browser detection that will work once IE7
is released. My current detection statement (written using VB.NET) is:
If Me.Request.Brow ser.Browser.ToU pper() = "IE" Then
'Code to use for Internet Explorer browsers
Else
'Code to use for browsers other than Internet Explorer
End If
In what ways would I need to modify this to make it work for IE7 as well?
Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/
Oct 9 '06 #1
10 1415
Nathan Sokalski wrote:
I want to make sure I am doing a browser detection that will work once IE7
is released. My current detection statement (written using VB.NET) is:
If Me.Request.Brow ser.Browser.ToU pper() = "IE" Then
'Code to use for Internet Explorer browsers
Else
'Code to use for browsers other than Internet Explorer
End If
In what ways would I need to modify this to make it work for IE7 as well?
Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/
The Beta is freely available, and may help you discover other areas
where you need to update/amend your site for IE7. Microsoft have also
got various resources for web developers to prepare for IE7, which I
think you can find on the microsoft web site.

Damien

Oct 9 '06 #2
"Nathan Sokalski" <nj********@hot mail.comwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..

Firstly, please don't cross-post...
If Me.Request.Brow ser.Browser.ToU pper() = "IE" Then
'Code to use for Internet Explorer browsers
Else
'Code to use for browsers other than Internet Explorer
End If
In what ways would I need to modify this to make it work for IE7 as well?
A five-second inspection of the Request.Browser class would have revealed
all its other properties...

My Beta3 copy of IE7 (7.0.5450.4) returns the following values (in
parentheses) to the Request.Browser object:

..ActiveXContro ls (True)
..AOL (False)
..BackgroundSou nds (True)
..Beta (False)
..Browser (IE)
..CDF (False)
..ClrVersion (2.0.50727)
..Cookies (True)
..Crawler (False)
..EcmaScriptVer sion (1.2)
..Frames (True)
..JavaApplets (True)
..JavaScript (True)
..MajorVersion (7)
..MinorVersion (0)
..MSDomVersion (7.0)
..Platform (WinXP)
..Tables (True)
..Type (IE7)
..VBScript (True)
..Version (7.0)
..W3CDomVersion (1.0)
..Win16 (False)
..Win32 (True)

I'm slightly puzzled about the .Beta property, which I would have expected
to return True instead of False...
Oct 9 '06 #3
Thank you for that sample. I think the reason for it returning Beta=False is
because of where it gets the properties, which is from a section of the
Web.config file called browserCaps which is matched against the User-Agent
string using regular expressions (or something like that, but I know it
doesn't send all the properties individually). I personally think that
Microsoft should do one of the following as far as getting the
Request.Browser object:

1. Create a different class that accesses a web service that they create to
determine the property values

OR

2. Give periodic updates for the <browserCapssec tion of the Web.config
file (they give periodic updates for Windows, Office, and several other
pieces of software, why not for this?)

But rather than complain about it, I'm happy for now since if your sample is
correct and the .Browser property returns "IE" I don't need to make any
changes to my code anyway. Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Mark Rae" <ma**@markNOSPA Mrae.comwrote in message
news:uD******** ******@TK2MSFTN GP04.phx.gbl...
"Nathan Sokalski" <nj********@hot mail.comwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..

Firstly, please don't cross-post...
>If Me.Request.Brow ser.Browser.ToU pper() = "IE" Then
'Code to use for Internet Explorer browsers
Else
'Code to use for browsers other than Internet Explorer
End If
In what ways would I need to modify this to make it work for IE7 as well?

A five-second inspection of the Request.Browser class would have revealed
all its other properties...

My Beta3 copy of IE7 (7.0.5450.4) returns the following values (in
parentheses) to the Request.Browser object:

.ActiveXControl s (True)
.AOL (False)
.BackgroundSoun ds (True)
.Beta (False)
.Browser (IE)
.CDF (False)
.ClrVersion (2.0.50727)
.Cookies (True)
.Crawler (False)
.EcmaScriptVers ion (1.2)
.Frames (True)
.JavaApplets (True)
.JavaScript (True)
.MajorVersion (7)
.MinorVersion (0)
.MSDomVersion (7.0)
.Platform (WinXP)
.Tables (True)
.Type (IE7)
.VBScript (True)
.Version (7.0)
.W3CDomVersion (1.0)
.Win16 (False)
.Win32 (True)

I'm slightly puzzled about the .Beta property, which I would have expected
to return True instead of False...

Oct 9 '06 #4
You could choose to just support up level browsers by setting the
ClientTarget.

http://msdn2.microsoft.com/en-us/lib...enttarget.aspx

You can set it also in the @Page directives.

http://msdn2.microsoft.com/en-us/library/x3k2ssx2.aspx

You would set it to "uplevel" to assume up level support. Since more
than 98% of your traffic will likely be coming from browsers which are
now "up level", you may find that is reasonable most of the time. It
is unlikely you will see IE4 or Netscape 4 browsers hitting your
website at all.

In fact, "up level" describes nearly all browsers released in the last
5 years which all have Cookie, CSS and Javascript support. A new
definition for Web 2.0 may need to be introduced with a wider set of
properties detailing features expected of this next level.

Brennan Stehling
http://brennan.offwhite.net/blog/

Nathan Sokalski wrote:
I want to make sure I am doing a browser detection that will work once IE7
is released. My current detection statement (written using VB.NET) is:
If Me.Request.Brow ser.Browser.ToU pper() = "IE" Then
'Code to use for Internet Explorer browsers
Else
'Code to use for browsers other than Internet Explorer
End If
In what ways would I need to modify this to make it work for IE7 as well?
Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/
Oct 9 '06 #5
My original question had nothing to do with whether or not I support up
level browsers (I am not usually specific to what browser is being used for
anything other than whether it uses JScript of JavaScript). My original
question was how to detect whether I am using IE with a method that will
work even once IE7 is available. The basic question my code is [hopefully]
asking is "Am I using Internet Explorer or some other browser?" I normally
do assume my visitors are using an up level browser, because anybody using a
browser that old really doesn't care whether or not the page works.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Brennan Stehling" <of******@gmail .comwrote in message
news:11******** *************@i 3g2000cwc.googl egroups.com...
You could choose to just support up level browsers by setting the
ClientTarget.

http://msdn2.microsoft.com/en-us/lib...enttarget.aspx

You can set it also in the @Page directives.

http://msdn2.microsoft.com/en-us/library/x3k2ssx2.aspx

You would set it to "uplevel" to assume up level support. Since more
than 98% of your traffic will likely be coming from browsers which are
now "up level", you may find that is reasonable most of the time. It
is unlikely you will see IE4 or Netscape 4 browsers hitting your
website at all.

In fact, "up level" describes nearly all browsers released in the last
5 years which all have Cookie, CSS and Javascript support. A new
definition for Web 2.0 may need to be introduced with a wider set of
properties detailing features expected of this next level.

Brennan Stehling
http://brennan.offwhite.net/blog/

Nathan Sokalski wrote:
>I want to make sure I am doing a browser detection that will work once
IE7
is released. My current detection statement (written using VB.NET) is:
If Me.Request.Brow ser.Browser.ToU pper() = "IE" Then
'Code to use for Internet Explorer browsers
Else
'Code to use for browsers other than Internet Explorer
End If
In what ways would I need to modify this to make it work for IE7 as well?
Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

Oct 10 '06 #6
"Nathan Sokalski" <nj********@hot mail.comwrote in message
news:Op******** *****@TK2MSFTNG P05.phx.gbl...

<snip>

Do you *really* have to cross-post...?
Oct 10 '06 #7
work even once IE7 is available. The basic question my code is [hopefully]
asking is "Am I using Internet Explorer or some other browser?" I normally
UserAgent must contain the following:

"Mozilla", "MSIE" and "Windows" (MSIE is also available on Mac).

--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujinionline.com
http://eduzine.edujinionline.com
-----------------------------------------
Oct 10 '06 #8
I'm using pretty much that exact code and have a Vista Beta 2 machine for testing and the server detects the IE7 running on the
Vista machine just fine (although I don't have the Upper specification and it still works).

By the way, IE7 beta is already out for use with XP (but it won't work with W2K from what I gather), so you don't even need a vista
machine to test it.

Jeff

"Nathan Sokalski" <nj********@hot mail.comwrote in message news:Op******** *****@TK2MSFTNG P05.phx.gbl...
My original question had nothing to do with whether or not I support up
level browsers (I am not usually specific to what browser is being used for
anything other than whether it uses JScript of JavaScript). My original
question was how to detect whether I am using IE with a method that will
work even once IE7 is available. The basic question my code is [hopefully]
asking is "Am I using Internet Explorer or some other browser?" I normally
do assume my visitors are using an up level browser, because anybody using a
browser that old really doesn't care whether or not the page works.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Brennan Stehling" <of******@gmail .comwrote in message
news:11******** *************@i 3g2000cwc.googl egroups.com...
You could choose to just support up level browsers by setting the
ClientTarget.

http://msdn2.microsoft.com/en-us/lib...enttarget.aspx

You can set it also in the @Page directives.

http://msdn2.microsoft.com/en-us/library/x3k2ssx2.aspx

You would set it to "uplevel" to assume up level support. Since more
than 98% of your traffic will likely be coming from browsers which are
now "up level", you may find that is reasonable most of the time. It
is unlikely you will see IE4 or Netscape 4 browsers hitting your
website at all.

In fact, "up level" describes nearly all browsers released in the last
5 years which all have Cookie, CSS and Javascript support. A new
definition for Web 2.0 may need to be introduced with a wider set of
properties detailing features expected of this next level.

Brennan Stehling
http://brennan.offwhite.net/blog/

Nathan Sokalski wrote:
I want to make sure I am doing a browser detection that will work once
IE7
is released. My current detection statement (written using VB.NET) is:
If Me.Request.Brow ser.Browser.ToU pper() = "IE" Then
'Code to use for Internet Explorer browsers
Else
'Code to use for browsers other than Internet Explorer
End If
In what ways would I need to modify this to make it work for IE7 as well?
Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/



--
Posted via a free Usenet account from http://www.teranews.com

Oct 11 '06 #9
That is good to know, but I seem to remember the beta versions (or at least
some of them) using a different UserAgent string than what the final version
will. Whether this will affect the detection code, I can't remember.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Jeff" <no**@none.comw rote in message
news:45******** *************** @free.teranews. com...
I'm using pretty much that exact code and have a Vista Beta 2 machine for
testing and the server detects the IE7 running on the
Vista machine just fine (although I don't have the Upper specification and
it still works).

By the way, IE7 beta is already out for use with XP (but it won't work
with W2K from what I gather), so you don't even need a vista
machine to test it.

Jeff

"Nathan Sokalski" <nj********@hot mail.comwrote in message
news:Op******** *****@TK2MSFTNG P05.phx.gbl...
>My original question had nothing to do with whether or not I support up
level browsers (I am not usually specific to what browser is being used
for
anything other than whether it uses JScript of JavaScript). My original
question was how to detect whether I am using IE with a method that will
work even once IE7 is available. The basic question my code is
[hopefully]
asking is "Am I using Internet Explorer or some other browser?" I
normally
do assume my visitors are using an up level browser, because anybody
using a
browser that old really doesn't care whether or not the page works.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Brennan Stehling" <of******@gmail .comwrote in message
news:11******* **************@ i3g2000cwc.goog legroups.com...
You could choose to just support up level browsers by setting the
ClientTarget.

http://msdn2.microsoft.com/en-us/lib...enttarget.aspx

You can set it also in the @Page directives.

http://msdn2.microsoft.com/en-us/library/x3k2ssx2.aspx

You would set it to "uplevel" to assume up level support. Since more
than 98% of your traffic will likely be coming from browsers which are
now "up level", you may find that is reasonable most of the time. It
is unlikely you will see IE4 or Netscape 4 browsers hitting your
website at all.

In fact, "up level" describes nearly all browsers released in the last
5 years which all have Cookie, CSS and Javascript support. A new
definition for Web 2.0 may need to be introduced with a wider set of
properties detailing features expected of this next level.

Brennan Stehling
http://brennan.offwhite.net/blog/

Nathan Sokalski wrote:
I want to make sure I am doing a browser detection that will work once
IE7
is released. My current detection statement (written using VB.NET) is:
If Me.Request.Brow ser.Browser.ToU pper() = "IE" Then
'Code to use for Internet Explorer browsers
Else
'Code to use for browsers other than Internet Explorer
End If
In what ways would I need to modify this to make it work for IE7 as
well?
Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/


--
Posted via a free Usenet account from http://www.teranews.com

Oct 12 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
4123
by: Frances Del Rio | last post by:
pls, why is this not working? <SCRIPT language=JavaScript type="text/javascript"> var br = '<SCRIPT language=Javascript' br += 'src="js_pop.js" type="text/javascript">' br += '</SCRIPT>' var op = '<SCRIPT language=Javascript' op += 'src="js_pop-op.js" type="text/javascript">' op += '</SCRIPT>' if (navigator.userAgent.indexOf('Opera') != -1 ) {
1
2469
by: Phil Townsend | last post by:
How does one detect for Internet Explorer on Windows CE? Does Request.Browser.Browser return anything unique for IE CE? I have a strange situation where I need to develop a user interface to a web app for CE, but at the moment I do not have a pocket device on which to test it. Anything else i should be aware of? Thanks! *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
2
1530
by: Sergey Poberezovskiy | last post by:
Hi, Simple question: I developed an ASP.Net application that runs under IE. Now for all other browsers I display a message that the application runs under IE: If Not System.Web.HttpContextCurrent.Request.Browser.Type.ToUpper
4
6961
by: mammen | last post by:
Hello, I'm writing trace log of various actions happening in my ASP.NET web application by opening a text file when the user logs in to the system and closing the file while the user logs out. This is especially to nail a hangout issue. The problem I'm facing is, when the application hangs and the user closes the browser using close(X) button I'm not able to close the text file(handle). This keeps the file handle open and the contents...
5
13702
by: Dag Sunde | last post by:
Is it possible to detect if the user minimizes the browser-window? I do some polling, and want to stop it while the window in minimized, but not when it only is blurred... TIA... -- Dag.
7
3004
by: Nathan Sokalski | last post by:
I want to make sure I am doing a browser detection that will work once IE7 is released. My current detection statement (written using VB.NET) is: If Me.Request.Browser.Browser.ToUpper() = "IE" Then 'Code to use for Internet Explorer browsers Else 'Code to use for browsers other than Internet Explorer End If
1
2321
by: Mango | last post by:
I'm trying to print some text in a very specific position on a page, so that it will show through the window of an envelope when folded. This is easy to do, as long as the browser's print margins are set to 0, or I subtract the width of the margins from the position of the text. My question is: is there a technique for detecting browser print margins? It'd be nice not to have to warn users to set them to something specific.
3
1345
by: Grzegorz Klimsa | last post by:
Hello I have problem with ASP.NET in C# language. I prepare two files of css style, one for ie ,second for firefox I want to set css style file depends on browser type I know how pull out info about sort of browser from browser (using Request.Browser.Type), but i have problem, how to load css file after execute Request.Browser.Type method in head
0
9544
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10490
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10238
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9077
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5589
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.