?
Solved

Checking Browser Type in an ASP Codes

Posted on 1998-10-12
8
Medium Priority
?
156 Views
Last Modified: 2010-04-09
Hi Experts,

   I would like to know how can I check my client browser
   type using ASP Code (Not Scripts) .

   I have a codes but only works sometime . Below is the
   code I have :

<%       Set BC=Server.CreateObject("MSWC.BrowserType") %>
<%       If (bc.ActiveXControls = TRUE) then %>


    Another question is I have a problem that is
    when a client site click on a link(Button), I
    got an error message telling about the security, language problem .....
    this only happens with IE 4 and not Netscape .
    When I went to the server machine, it does not show me the error message . ?????????????????????/

    What could be the likely cause of this .

    Please enlighten my query . Thanks
0
Comment
Question by:seahpc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 28

Expert Comment

by:sybe
ID: 1838634
Request.ServerVariables("
HTTP_USER_AGENT  
") gives you some indication of the browser type.
0
 
LVL 11

Expert Comment

by:mouatts
ID: 1838635
If the code you are using is executed on the client it will only work if it is IE and browcap.ini is present on the machine.

But otherwise your code is OK.

So far you second question is concerned you will need to provide more details but do it as a seperate question. :)

Steve
0
 
LVL 2

Author Comment

by:seahpc
ID: 1838636
Let me give you a case .
At first I use machine (A) as my webserver and
I use another machine(B) to surf the site .
It works fine (for IE it gives me icons and Netscape gives me button)

Now I copy everything into another machine that is link directly out to the internet .
Again I use machine (B) and surf to the site .
But now I got Buttons for both IE and Netscape
and both Browser gives me bc.ActiveXControls = FALSE
Why ?

0
WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

 
LVL 28

Accepted Solution

by:
sybe earned 300 total points
ID: 1838637
Because of the browscap.ini. This file is in C:\WinnT\system32\inetsvr\asp. You have to have the most recent version.  On the second machine, there is probably an old browscap.ini, which does not know the version of IE you work are using. And "unknown" means that is says: ActiveXControls = FALSE.

Just copy the browscap.ini frome one machine to the other. Or get the most recent version from Microsoft.
0
 
LVL 2

Author Comment

by:seahpc
ID: 1838638
Hi Sibe, I have uses your earlier suggestion using the Server Variables .
Thanks . See if you can answer the second part of my question .
0
 
LVL 28

Expert Comment

by:sybe
ID: 1838639
Glad that you solved your problem.
For the second part I would need some code, because now I can only guess what is happening.
0
 
LVL 2

Author Comment

by:seahpc
ID: 1838640
I do not have any sample codes for that as
it only happens sometimes .
But I found that it is related to redirect of page (Response.Redirect ("..."))

0
 
LVL 28

Expert Comment

by:sybe
ID: 1838641
Hmm, redirect causes problems like that. Make sure that you don't redirect to an ASP which uses a different global.asa. But I am not sure that this is the cause.
0

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question