Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Mobile > PPC Emulator, Pocket IE, Browser Capabilities

Reply
Thread Tools

PPC Emulator, Pocket IE, Browser Capabilities

 
 
Isaac C.
Guest
Posts: n/a
 
      09-05-2004
Hello. I have developed analagous ASP.NET and Mobile ASP.NET applications.
I have this code snippet that examines the request's browser capabilities.
Using the PPC emulator that came with the PPC 2003 SDK, "IsMobileDevice"
always comes back explicitly as false. Is there something further I am
supposed to do? With machine.config perhaps?

If (Request.Browser("IsMobileDevice") = "true") Then
Response.Redirect("../MobileVersion/Default.aspx", True)
Else
Response.Redirect("../NonMobileVersion/Default.aspx", True)
End If

--Isaac

 
Reply With Quote
 
 
 
 
Yan-Hong Huang[MSFT]
Guest
Posts: n/a
 
      09-06-2004
Hello Isasc,

Could you please try the following two methods?

1) Change web.config file:
Please try the following steps to solve the problem without changing the C#
code in the default.aspx.

1. Open the web.config in notepad.
2. Locate the following line in the config file:
</system.web>
3. Replace the line with the following text:
<browserCaps>
<use var="HTTP_USER_AGENT" as="user_agent" />
<filter>
<case match="Windows CE" with="%{user_agent}">
IsMobileDevice = "true"
</case>
</filter>
</browserCaps>
4. Save the web.config.
5. Browse the page again in Pocket PC 2003.

This config is to tell the system if the HTTP_USER_AGENT information
contains "Windows CE", we'd like to set the IsMobileDevice to true. So,
Request.Browser["IsMobileDevice"] will returns true if the HTTP_USER_AGENT
contains "Windows CE".

if (Request.Browser["IsMobileDevice"] == "true") {

Response.Redirect("MobileDefault.aspx");
}
else {

Response.Redirect("DesktopDefault.aspx");
}

For Pocket PC 2002/2003 and Smartphone 2003, the HTTP_USER_AGENT always
contains "Windows CE". This is why the above method works.

2) Another way you can try is to change C# code:

To solve the problem, please open the default.aspx page of the Portal and
locate the following code:
if (Request.Browser["IsMobileDevice"] == "true")
Replace the above code with the following solves the problem:
if (Request.Browser["IsMobileDevice"] == "true" ||
Request.Browser["Platform"] == "WinCE")

Hope that helps.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ĘC www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
-http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.as
p&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
 
 
 
Yan-Hong Huang[MSFT]
Guest
Posts: n/a
 
      09-08-2004
Hello Isasc,

Do you have any more concerns on this issue? If the problem is not resolved
yet, please feel free to post here and we will follow up.

Thanks very much.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ĘC www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
-http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.as
p&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to embed audio <OBJECT/>s conditional on browser capabilities ewan.dunbar@utoronto.ca HTML 2 03-19-2008 07:29 PM
Adding Browser Capabilities for new device in asp.net1.1 Nadav Popplewell ASP .Net 4 01-21-2008 01:41 PM
detecting browser encryption capabilities Linus Nikander Java 1 09-20-2004 09:29 AM
browser javascript capabilities Lance ASP .Net 1 08-14-2004 02:55 PM
Setting initial focus in html using Javascript - Pocket IE on Windows 2003 Pocket PC dsnyder Javascript 2 04-14-2004 03:58 PM



Advertisments