Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I need some help with this code for vb.net. I have an ASP page (index.asp) and i found this code that if you view my site on a cell phone, it would redirect you to the cell phone (WAP) version of the site.

Sub Page_Load()

   Dim isPPC

   Dim httpAccept As String

   isPPC = Request.ServerVariables("HTTP_UA_OS")

   httpAccept = LCase(Request.ServerVariables("HTTP_ACCEPT"))


   If InStr(isPPC, "POCKET PC") Then

       response.redirect("--your PocketPC page--")

   Else

       If Instr(httpAccept,"wap") Then

           response.redirect("--your WAP page--")

       End If

   End If

End Sub

Now i am new at .net programming but i have a good grasp on ASP now. I need to know where i need to put that code in my asp page. Ive tryed the code with the <% %> at the start and ending of it at the very top of my asp page, but it still loads up the normal site on my cell phone.

 

If anyone knows how to correct this, please let me know :)

 

David

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...