Link to home
Start Free TrialLog in
Avatar of seahpc
seahpc

asked on

Checking Browser Type in an ASP Codes

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
Avatar of sybe
sybe

Request.ServerVariables("
HTTP_USER_AGENT  
") gives you some indication of the browser type.
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
Avatar of seahpc

ASKER

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 ?

ASKER CERTIFIED SOLUTION
Avatar of sybe
sybe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of seahpc

ASKER

Hi Sibe, I have uses your earlier suggestion using the Server Variables .
Thanks . See if you can answer the second part of my question .
Glad that you solved your problem.
For the second part I would need some code, because now I can only guess what is happening.
Avatar of seahpc

ASKER

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 ("..."))

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.