473,418 Members | 2,047 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 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 3727
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",...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.