Hi,

Both browsers-compatible Web Pages makes your work twice harder!!

But, you can use the Server Variable HTTP_USER_AGENT to detect the client
browser from the server side.

Into your ASP page, your can use this:

    bUsingMSIE = CBool(InStr(Request.ServerVariables("HTTP_USER_AGENT"),
"MSIE") > 0)

    If bUsingMSIE Then
        ' Script for IE Only.....
    Else
        ' Script for Netscape....
    End If


With a little work, your can get the version of the browser:
(copy this into an ASP page and check out...)

    <%@Language=VBScript%>
    <%
        Function ValidChar(Character)
            If Character >= "0" And Character <= "9" Then
                ValidChar = True
            ElseIf Character = "." Or Character = "" Then
                ValidChar = True
            ElseIf Character >= "a" And Character <= "z" Then
                ValidChar = True
            ElseIf Character >= "A" And Character <= "Z" Then
                ValidChar = True
            Else
                ValidChar = False
            End If
        End Function

        Function ParseRelease(Release)
            Dim i

            Do Until ValidChar(Left(Release, 1)) Or Release = ""
                Release = Mid(Release, 2)
            Loop

            i = 2

            Do Until Not ValidChar(Mid(Release, i, 1)) Or i > Len(Release)
                i = i + 1
            Loop

            ParseRelease = Left(Release, i-1)
        End Function
    %>

    <html>
    <head>
    <title>ServerSide Browser Check</title>
    </head>

    <body>
    <p>Browser detected: <%
        sUserAgent = Request.ServerVariables("HTTP_USER_AGENT")

        ' Check for Mozilla Version.
        nPosMozi = InStr(sUserAgent, "Mozilla")
        sVerMozi = Mid(sUserAgent, nPosMozi + Len("Mozilla") + 1)
        sVerMozi = ParseRelease(sVerMozi)

        nPosMSIE = InStr(sUserAgent, "MSIE")
        sVerMSIE = Mid(sUserAgent, nPosMSIE + Len("MSIE") + 1)
        sVerMSIE = ParseRelease(sVerMSIE)

        If nPosMSIE = 0 Then
            Response.Write "Netscape Navigator " & sVerMozi
        Else
            Response.Write "Microsoft Internet Explorer " & sVerMSIE
        End If
    %></p>
    </body>
    </html>


Bye

PeterMoon ([EMAIL PROTECTED])


----- Original Message -----
From: "raju raju" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 28, 2001 11:04 AM
Subject: Re: ASP Forms


write me detaily about your problem when you run same
ASP pages on IE and Netscape.but one thing,when you
run any HTML,ASP pages it should be properly opoend
and closed,But IE is not like that.
bye
raju([EMAIL PROTECTED])


--- Raghu Vamshi <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Would you please tell me - "When creating forms
> using
> ASP, how to make them compatible both in Internet
> Explorer and Netscape browsers." This is creating a
> real problem for me to create web pages.
>
> Thanks,
> Raghu
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.com/
>
> ^^^^^^^^^^^^^^^^^^^ http://asp-lists.com/
> ^^^^^^^^^^^^^^^^^^
>              Get Your ASP On The Fast Track!
> Join the growing number of Application Service
> Provider pros
> using the ASP-Lists to maximize their company's
> potential.
>
> _____________  The Website Services ASP Discussion
> List  _____________
> To Join: mailto:[EMAIL PROTECTED]
> To Remove:
> mailto:[EMAIL PROTECTED]
> Archives:
http://www.asp-lists.com/apptypes/website-services/archives/


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/?.refer=text

^^^^^^^^^^^^^^^^^^^ http://asp-lists.com/ ^^^^^^^^^^^^^^^^^^
             Get Your ASP On The Fast Track!
Join the growing number of Application Service Provider pros
using the ASP-Lists to maximize their company's potential.

_____________  The Website Services ASP Discussion List  _____________
To Join: mailto:[EMAIL PROTECTED]
To Remove: mailto:[EMAIL PROTECTED]
Archives: http://www.asp-lists.com/apptypes/website-services/archives/




^^^^^^^^^^^^^^^^^^^ http://asp-lists.com/ ^^^^^^^^^^^^^^^^^^
             Get Your ASP On The Fast Track!
Join the growing number of Application Service Provider pros
using the ASP-Lists to maximize their company's potential.

_____________  The Website Services ASP Discussion List  _____________
To Join: mailto:[EMAIL PROTECTED]
To Remove: mailto:[EMAIL PROTECTED]
Archives: http://www.asp-lists.com/apptypes/website-services/archives/

Reply via email to