Last post Dec 07, 2007 03:37 AM by slavik118
Sep 07, 2006 04:26 PM|RyanSmith345|LINK
I'm building a mobile version of a site that I created in ASP.NET 2.0. I have the landing page redirect over to the mobile page using
This didn't work for the BlackBerry, so I craeted a check for user agent to redirect correctly. Now I have noticed that all of the new web enabled phones don't register themselves as mobile devices. I really need a catch all for any mobile device, regardless
if it registers as mobile or not.
Does anyone know how I can solve this issue? What should I be looking for in the request parameters.
Sep 21, 2006 11:50 AM|jamsweb|LINK
hya i dont know if this will work for you, but have you tried getting the server variable (HTTP_ACCEPT) then check if it contains (application/vnd.wap.xhtml+xml)
Sep 21, 2006 01:00 PM|RyanSmith345|LINK
I'll give that a try, but I think the problem is that the modern wireless devices make themselves look as much like a regular browser as possible. This is what's causing me issues is there is no longer a user agent or header that says "yes, I'm a wireless
device", at least not one that I have found.
Thanks for the suggestion though.
Sep 21, 2006 01:38 PM|jamsweb|LINK
i tend to agree with you on that ryan. in the past ive used logic similiar to this:
IF (HTTP_ACCEPT).contains "text/vnd.wap.wml" THEN (device = WAP 1.0)
IF (HTTP_ACCEPT).contains "application/vnd.wap.xhtml+xml" THEN (device = WAP 2.0) ->(newest WAP XHTML mobileprofile)
IF both of the above are not true THEN (device = WEB browser)
that is the logic ive used in the past even that does not always work in all situations. so i resorted to making a list of user_agents in my database for the unknown ones. and redirecting as needed.
if any1 has a good solution on this i would like to know myself. thanx
Dec 06, 2007 12:53 PM|jgo23|LINK
I realize this is an old thread, but if anyone is running to the same issue as the OP, you may want to read the following link:
Dec 06, 2007 01:03 PM|RyanSmith345|LINK
Thanks for your reply, but that was the original problem. Since most modern mobile web browsers don't identify themselves as mobile devices, that code doesn't get the job done.
I found that most people browsing the site on a mobile device will be using a BlackBerry, so that was the simple solution for me. Unfortunately, it still doesn't address the underlying problem.
Dec 06, 2007 02:04 PM|slavik118|LINK
You need to detect BlackBerry browser type to address the problem. Try to add following adjustments to the code shown on MSDN:
<script runat="server" language="c#">
public void Page_Load(Object sender, EventArgs e)
if (Request.Browser["IsMobileDevice"] ==
"true" || Request.Browser["BlackBerry"] ==
Dec 06, 2007 02:44 PM|RyanSmith345|LINK
I understand how to solve that problem. What I'm complaining about is it would be nice to have some sort of method like "Request.Browser.IsMobileDevice" actually work correctly and hit all the different mobile browsers. As it stands now, that method is
so far deprecated that it's not worth using.
I guess with the new world of mobile browsers, mobile friendly web pages will just need to be done through CSS and clean HTML.
Dec 07, 2007 03:37 AM|slavik118|LINK