Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Browser Capability

Reply
Thread Tools

Browser Capability

 
 
Prabhat
Guest
Posts: n/a
 
      09-29-2005
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


 
Reply With Quote
 
 
 
 
Danny@Kendal
Guest
Posts: n/a
 
      09-29-2005
"Prabhat" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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%>


 
Reply With Quote
 
 
 
 
Prabhat
Guest
Posts: n/a
 
      09-29-2005

"Danny@Kendal" <(E-Mail Removed)> 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


 
Reply With Quote
 
Danny@Kendal
Guest
Posts: n/a
 
      09-30-2005
"Prabhat" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>
> "Danny@Kendal" <(E-Mail Removed)> 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mechanoid Web Browser - Recording Capability Seymour Python 7 09-20-2006 06:42 PM
WPA Capability =?Utf-8?B?TXlzdGlmaWVk?= Wireless Networking 4 05-14-2005 03:58 AM
VLAN Capability Kapamarou Cisco 13 12-10-2003 06:47 PM
URGENT! Cisco expert for 2621VPN,1721,PIX 506E Network Design capability qazaka Cisco 0 09-24-2003 04:06 PM
ISDN dial out capability Clayton Cisco 3 07-16-2003 05:29 PM



Advertisments