By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,979 Members | 943 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,979 IT Pros & Developers. It's quick & easy.

Browser Capability

P: n/a
Hi All,

I have IE6.0 SP1 and I executed one asp file with the below script to check
the browser capability but see the result below the script...Copied from
MSDN :)

<% Set bc = Server.CreateObject("MSWC.BrowserType") %>
Browser: <%= bc.browser %><BR>
Version: <%= bc.version %><BR>
Supports frames?
<% If (bc.frames = "true") then %>
Yes<BR>
<% Else %>
No<BR>
<% End If %>
Supports tables?
<% If (bc.tables = "true") then %>
Yes<BR>
<% Else %>
No<BR>
<% End If %>
Supports background sounds?
<% If (bc.BackgroundSounds = "true") then %>
Yes<BR>
<% Else %>
No<BR>
<% End If %>
Supports VBScript?
<% If (bc.vbscript = "true") then %>
Yes<BR>
<% Else %>
No<BR>
<% End If %>
Supports JavaScript?
<% If (bc.javascript = "true") then %>
Yes<BR>
<% Else %>
No<BR>
<% End If %>
OUTPUT:

Browser: Netscape
Version: 4.00
Supports frames? No
Supports tables? No
Supports background sounds? No
Supports VBScript? No
Supports JavaScript? No

why does the answeres shows wrong value while the IE6 supports all.

Thanks
Prabhat
Sep 29 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Prabhat" <no********@hotmail.com> wrote in message
news:e6**************@TK2MSFTNGP12.phx.gbl...
Hi All,

I have IE6.0 SP1 and I executed one asp file with the below script to
check
the browser capability but see the result below the script...Copied from
MSDN :)

<% Set bc = Server.CreateObject("MSWC.BrowserType") %>
Browser: <%= bc.browser %><BR>
Version: <%= bc.version %><BR>
Supports frames?
<% If (bc.frames = "true") then %>
Yes<BR>
<% Else %>
No<BR>
<% End If %>
<snip>
why does the answeres shows wrong value while the IE6 supports all.


Because you're testing for a string value of "true" rather than the boolean
value of TRUE.
Change "true" to true or remove the ="true" part completely.

ie:
<%if (bc.frames) then%>
Yes<br>
<%else%>
No<br>
<%end if%>
Sep 29 '05 #2

P: n/a

"Danny@Kendal" <da***@STOPSPAMghpkendal.co.uk> wrote
Because you're testing for a string value of "true" rather than the boolean value of TRUE.
Change "true" to true or remove the ="true" part completely.

ie:
<%if (bc.frames) then%>
Yes<br>
<%else%>
No<br>
<%end if%>


Ok. you are right...

But now i have rectified that and got the below result.

Browser: Netscape
Version: 4.00
Supports frames? Yes
Supports tables? Yes
Supports background sounds? No
Supports VBScript? No
Supports JavaScript? Yes

It says NO to VBS and Sound ? also the browser is Netscape ? are these
correct?

Thanks
Prabhat
Sep 29 '05 #3

P: n/a
"Prabhat" <no********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...

"Danny@Kendal" <da***@STOPSPAMghpkendal.co.uk> wrote
Because you're testing for a string value of "true" rather than the

boolean
value of TRUE.
Change "true" to true or remove the ="true" part completely.

ie:
<%if (bc.frames) then%>
Yes<br>
<%else%>
No<br>
<%end if%>


Ok. you are right...

But now i have rectified that and got the below result.

Browser: Netscape
Version: 4.00
Supports frames? Yes
Supports tables? Yes
Supports background sounds? No
Supports VBScript? No
Supports JavaScript? Yes

It says NO to VBS and Sound ? also the browser is Netscape ? are these
correct?


Right, I'll try again now the work Internet connection is work....
Damn! There it goes again for the brazillionth time this week.
Oh! It's back up so I'd better type quickly.

If I set Opera to identify as Internet Explorer then I get the same results.
If I set it to identify as itself I get a more accurate result.

Personally I wouldn't bother trying to work out what browser is being used.
It's not reliable.
Sep 30 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.