473,399 Members | 2,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

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.Browser.Browser.ToUpper() = "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********@hotmail.com
http://www.nathansokalski.com/
Oct 9 '06 #1
10 1386
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.Browser.Browser.ToUpper() = "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********@hotmail.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********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...

Firstly, please don't cross-post...
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
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:

..ActiveXControls (True)
..AOL (False)
..BackgroundSounds (True)
..Beta (False)
..Browser (IE)
..CDF (False)
..ClrVersion (2.0.50727)
..Cookies (True)
..Crawler (False)
..EcmaScriptVersion (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 <browserCapssection 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********@hotmail.com
http://www.nathansokalski.com/

"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:uD**************@TK2MSFTNGP04.phx.gbl...
"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...

Firstly, please don't cross-post...
>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
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:

.ActiveXControls (True)
.AOL (False)
.BackgroundSounds (True)
.Beta (False)
.Browser (IE)
.CDF (False)
.ClrVersion (2.0.50727)
.Cookies (True)
.Crawler (False)
.EcmaScriptVersion (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.Browser.Browser.ToUpper() = "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********@hotmail.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********@hotmail.com
http://www.nathansokalski.com/

"Brennan Stehling" <of******@gmail.comwrote in message
news:11*********************@i3g2000cwc.googlegrou ps.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.Browser.Browser.ToUpper() = "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********@hotmail.com
http://www.nathansokalski.com/

Oct 10 '06 #6
"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:Op*************@TK2MSFTNGP05.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********@hotmail.comwrote in message news:Op*************@TK2MSFTNGP05.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********@hotmail.com
http://www.nathansokalski.com/

"Brennan Stehling" <of******@gmail.comwrote in message
news:11*********************@i3g2000cwc.googlegrou ps.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.Browser.Browser.ToUpper() = "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********@hotmail.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********@hotmail.com
http://www.nathansokalski.com/

"Jeff" <no**@none.comwrote 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********@hotmail.comwrote in message
news:Op*************@TK2MSFTNGP05.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********@hotmail.com
http://www.nathansokalski.com/

"Brennan Stehling" <of******@gmail.comwrote in message
news:11*********************@i3g2000cwc.googlegro ups.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.Browser.Browser.ToUpper() = "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********@hotmail.com
http://www.nathansokalski.com/


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

Oct 12 '06 #10
re:
Whether this will affect the detection code, I can't remember.
Nathan,

Request.Browser.Type returns "IE7".
Request.Browser.Browser + Request.Browser.Version returns "IE7.0".

You can use either of those to detect IE 7.0.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:OS**************@TK2MSFTNGP05.phx.gbl...
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********@hotmail.com
http://www.nathansokalski.com/

"Jeff" <no**@none.comwrote 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********@hotmail.comwrote in message
news:Op*************@TK2MSFTNGP05.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********@hotmail.com
http://www.nathansokalski.com/

"Brennan Stehling" <of******@gmail.comwrote in message
news:11*********************@i3g2000cwc.googlegr oups.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.Browser.Browser.ToUpper() = "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********@hotmail.com
http://www.nathansokalski.com/

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


Oct 12 '06 #11

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

Similar topics

10
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...
1
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...
2
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...
4
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....
5
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
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"...
1
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...
3
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.