472,808 Members | 3,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,808 software developers and data experts.

IsMobileDevice returns false when connecting with WM 2003

First of all, sorry for cross-posting, but this newsgroup is much busier
than "aspnet.mobile".

I'm trying to create a portal page that redirects depending on the device
that is connecting.

When I use Request.Browser("IsMobileDevice"), it returns false when
connecting with my iPAQ
2215 (and other Windows Mobile 2003 devices), although
HTTPBrowserCapabilities "Platform" returns "WinCE".

What's going on? I'm using VS.NET2003 for development with DeviceUpdate4
installed.

I had a code snippet like (suggested by the MS "Best Practices" page at
http://msdn.microsoft.com/library/de...practaui.asp):

If Not (Page.IsPostBack) Then
If (Device.IsMobileDevice) Then
RedirectToMobilePage("mobile/m_default.aspx")
Else
Response.Redirect("default.aspx")
End If
End If

It used to work just fine, but now "Device.IsMobileDevice" also returns
false.

Does anybody in this group have a clue why this is happening?

Also, why is has MS not released another device update? The latest one is
over a year old.

Thanks,

Sacha
Nov 19 '05 #1
4 3691
IsMobileDevice is a property of the MobileCapabilities class. You need to
inherit the MobilePage and cast the Request.Browser instance to a
MobileCapabilities instance:

<%@ Page Inherits="System.Web.UI.MobileControls.MobilePage"
Language="whatever" %>
<%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>

MobileCapabilities currentCapabilities =
(MobileCapabilities)Request.Browser;
result = currentCapabilities.IsMobileDevice;
"Sacha Korell" <ko****@huntsville.sparta.com> wrote in message
news:uA**************@TK2MSFTNGP11.phx.gbl...
First of all, sorry for cross-posting, but this newsgroup is much busier
than "aspnet.mobile".

I'm trying to create a portal page that redirects depending on the device
that is connecting.

When I use Request.Browser("IsMobileDevice"), it returns false when
connecting with my iPAQ
2215 (and other Windows Mobile 2003 devices), although
HTTPBrowserCapabilities "Platform" returns "WinCE".

What's going on? I'm using VS.NET2003 for development with DeviceUpdate4
installed.

I had a code snippet like (suggested by the MS "Best Practices" page at
http://msdn.microsoft.com/library/de...practaui.asp):
If Not (Page.IsPostBack) Then
If (Device.IsMobileDevice) Then
RedirectToMobilePage("mobile/m_default.aspx")
Else
Response.Redirect("default.aspx")
End If
End If

It used to work just fine, but now "Device.IsMobileDevice" also returns
false.

Does anybody in this group have a clue why this is happening?

Also, why is has MS not released another device update? The latest one is
over a year old.

Thanks,

Sacha

Nov 19 '05 #2
That's exactly what I'm doing in my current code. Here's the whole
code-behind:

Public Class check_device
Inherits System.Web.UI.MobileControls.MobilePage
Protected WithEvents Form1 As System.Web.UI.MobileControls.Form

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

End Sub

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here

Dim objCapabilities As System.Web.Mobile.MobileCapabilities

objCapabilities = CType(Request.Browser,
System.Web.Mobile.MobileCapabilities)

If objCapabilities.IsMobileDevice Then
'Redirect to mobile page
Response.Write("Mobile Device")
Else
'Redirect to regular web app
Response.Write("Not a Mobile Device")
End If

End Sub

End Class

This code produces the Response.Write("Not a Mobile Device") when I hit it
with a "Windows Mobile 2003" device. However, when I connect with a "Windows
Mobile 2002" device, it does produce the desired output.

Do you think it might have something to do with server or config settings?

Thanks,

Sacha

"Alex Homer" <al**@stonebroom.com> wrote in message
news:ul**************@TK2MSFTNGP14.phx.gbl...
IsMobileDevice is a property of the MobileCapabilities class. You need to
inherit the MobilePage and cast the Request.Browser instance to a
MobileCapabilities instance:

<%@ Page Inherits="System.Web.UI.MobileControls.MobilePage"
Language="whatever" %>
<%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>

MobileCapabilities currentCapabilities =
(MobileCapabilities)Request.Browser;
result = currentCapabilities.IsMobileDevice;
"Sacha Korell" <ko****@huntsville.sparta.com> wrote in message
news:uA**************@TK2MSFTNGP11.phx.gbl...
First of all, sorry for cross-posting, but this newsgroup is much busier
than "aspnet.mobile".

I'm trying to create a portal page that redirects depending on the device
that is connecting.

When I use Request.Browser("IsMobileDevice"), it returns false when
connecting with my iPAQ
2215 (and other Windows Mobile 2003 devices), although
HTTPBrowserCapabilities "Platform" returns "WinCE".

What's going on? I'm using VS.NET2003 for development with DeviceUpdate4
installed.

I had a code snippet like (suggested by the MS "Best Practices" page at

http://msdn.microsoft.com/library/de...practaui.asp):

If Not (Page.IsPostBack) Then
If (Device.IsMobileDevice) Then
RedirectToMobilePage("mobile/m_default.aspx")
Else
Response.Redirect("default.aspx")
End If
End If

It used to work just fine, but now "Device.IsMobileDevice" also returns
false.

Does anybody in this group have a clue why this is happening?

Also, why is has MS not released another device update? The latest one is
over a year old.

Thanks,

Sacha


Nov 19 '05 #3
write a test page that displays

Page.Request.ServerVariables["HTTP_USER_AGENT"]

then in the machine.config file update the browsercaps section to support
your iPAQ's useragent string.

-- bruce (sqlwork.com)
"Sacha Korell" <ko****@huntsville.sparta.com> wrote in message
news:uA**************@TK2MSFTNGP11.phx.gbl...
| First of all, sorry for cross-posting, but this newsgroup is much busier
| than "aspnet.mobile".
|
| I'm trying to create a portal page that redirects depending on the device
| that is connecting.
|
| When I use Request.Browser("IsMobileDevice"), it returns false when
| connecting with my iPAQ
| 2215 (and other Windows Mobile 2003 devices), although
| HTTPBrowserCapabilities "Platform" returns "WinCE".
|
| What's going on? I'm using VS.NET2003 for development with DeviceUpdate4
| installed.
|
| I had a code snippet like (suggested by the MS "Best Practices" page at
|
http://msdn.microsoft.com/library/de...practaui.asp):
|
| If Not (Page.IsPostBack) Then
| If (Device.IsMobileDevice) Then
| RedirectToMobilePage("mobile/m_default.aspx")
| Else
| Response.Redirect("default.aspx")
| End If
| End If
|
| It used to work just fine, but now "Device.IsMobileDevice" also returns
| false.
|
| Does anybody in this group have a clue why this is happening?
|
| Also, why is has MS not released another device update? The latest one is
| over a year old.
|
| Thanks,
|
| Sacha
|
|
Nov 19 '05 #4
Thanks Bruce, I'll try that. I just thought it should be much easier than
having to hack the machine.config for every new PDA device/OS version. What
happened to device updates from Microsoft?

Sacha

"bruce barker" <no***********@safeco.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
write a test page that displays

Page.Request.ServerVariables["HTTP_USER_AGENT"]

then in the machine.config file update the browsercaps section to support
your iPAQ's useragent string.

-- bruce (sqlwork.com)
"Sacha Korell" <ko****@huntsville.sparta.com> wrote in message
news:uA**************@TK2MSFTNGP11.phx.gbl...
| First of all, sorry for cross-posting, but this newsgroup is much busier
| than "aspnet.mobile".
|
| I'm trying to create a portal page that redirects depending on the
device
| that is connecting.
|
| When I use Request.Browser("IsMobileDevice"), it returns false when
| connecting with my iPAQ
| 2215 (and other Windows Mobile 2003 devices), although
| HTTPBrowserCapabilities "Platform" returns "WinCE".
|
| What's going on? I'm using VS.NET2003 for development with DeviceUpdate4
| installed.
|
| I had a code snippet like (suggested by the MS "Best Practices" page at
|
http://msdn.microsoft.com/library/de...practaui.asp):
|
| If Not (Page.IsPostBack) Then
| If (Device.IsMobileDevice) Then
| RedirectToMobilePage("mobile/m_default.aspx")
| Else
| Response.Redirect("default.aspx")
| End If
| End If
|
| It used to work just fine, but now "Device.IsMobileDevice" also returns
| false.
|
| Does anybody in this group have a clue why this is happening?
|
| Also, why is has MS not released another device update? The latest one
is
| over a year old.
|
| Thanks,
|
| Sacha
|
|

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: lkrubner | last post by:
www.php.net says: >>>>>>>>>>>> Only for SELECT,SHOW,EXPLAIN or DESCRIBE statements mysql_query() returns a resource identifier or FALSE if the query was not executed correctly. For other type of...
3
by: edwinek | last post by:
Hi, According to the API specification, javax.xml.parsers.DocumentBuilder.parse should return an org.w3c.dom.Document. However, when I use the following code: DocumentBuilderFactory factory =...
48
by: Skybuck Flying | last post by:
Hi, I came across this C code which I wanted to understand etc it looked like this: if (-1) etc It made me wonder what the result would be... true or false ? In C and Delphi
0
by: John Bravo | last post by:
Hi, I am hosting a .NET Passport Site in Pre-Production environment ( Windows 2003 Server, IIS 6, Passport 2.5). Issue 1) The site is working fine ( I am able to signout and signin) when I...
0
by: Boris Zakharin | last post by:
I am using the .Net framework 1.1 and VS.NET 2003. I have some code where, for some reason, IsPostBack returns false messing up my code. I have a DataGrid, whose data I am trying to edit. Instead...
1
by: johnlcox | last post by:
I am developing an intranet site and I would like to make it available to mobile devices without the full feature set, so that it is easier to navigate on the mobile device. Most of our employees...
2
by: Schorschi | last post by:
Can't seemd to get ReadFile API to work! Returns invalid handle error? =========================================================================== Ok, the visual basic gurus, help! The...
12
by: snow | last post by:
Hi All, I noticed if file path has a white space, for example "C:\my document \test.txt", the function File.Exists(filePath) always return false in release mode. How could I make this function...
1
by: Akino877 | last post by:
Hello, I am writing a simple PHP script to see if I can make a connection to my Oracle database. And it showed that my call to OCILogon() failed. But my call to OCIError() returned "False",...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.