Results 1 to 8 of 8

Thread: ASP and the Wireless Web

  1. #1
    WALDO
    Guest

    ASP and the Wireless Web

    I'm looking to develop a hybrid site for regular web browsers and wireless browsers. It would be ideal if I could use ASP to generate XML, then use XSL to transform my content to HTML or WML depending on which type of browser you are using.

    The question becomes, how do I determine if you have a Wireless browser? How can I tell if you're using one of those little phones to look at my site, rather than IE or Netscape?

    I was thinking of using the ServerVariable, HTTP_USER_AGENT. It returns "Mozilla..." when I look at it in IE; "NOKIA..." when I look at it though my WAP Emulator; "500:Internal Server Error" on an actual phone.

    Does anyone know how I might be able to determine this via ASP?

  2. #2
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Code:
    If (Instr(1,Lcase(Request.ServerVariables("HTTP_ACCEPT")),"wap") <> 0) Then
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  3. #3
    WALDO
    Guest

    Hmmm...OK

    Would it ever be possible for wap to appear in that variable when browsing w/ IE/NS?

  4. #4
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    If the User Agent says it will support WAP, then you can send it to them.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  5. #5
    WALDO
    Guest
    I meant the HTTP_ACCEPT

    I liked your idea but if I'm basing whether to spit out WML or HTML based on that, I'd like to be sure that IE/Netscape won't produce wap somewhere in the HTTP_ACCEPT variable

  6. #6
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Originally posted by WALDO
    I meant the HTTP_ACCEPT

    I liked your idea but if I'm basing whether to spit out WML or HTML based on that, I'd like to be sure that IE/Netscape won't produce wap somewhere in the HTTP_ACCEPT variable
    I don't think they normally would, but you could check for the whole "application/wap" or whatever they would send. It they do send it (maybe an add-on or plug-in is installed), then you could send them the WAP as they are saying they'll accept it, or check for a "text/html" in the accept. IE6 sends "Accept: */*".
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  7. #7
    WALDO
    Guest
    I think I'm going to look for HTTP_ACCEPT to contain

    text/vnd.wap.wml

  8. #8
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Yeah, that's it.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width