Jason Salas' WebLog

On-air and online: making people laugh, making people think, pissing people off

ASP.NET sites that kick ass

Pals with blogs

Podcasts I listen to

Proper platform/device filtering for MMIT mobile content in ASP.NET 1.x

I've got yet another reason to appreciate Google so much.  One thing I've noticed about browsing Google when using Pocket IE on Windows Mobile 2003 or Blazer with Palm OS 5 is that the search engine detects the presence of such a mobile device browser, and displays an alternative, PDA-friendly page.  I too, filter the displayed content based on the requesting platform (or so I thought), conditionally rendering a simple page for wireless browsers and going all out with DHTML, XML/XSLT, database connectivity, etc. over the public (and largely desktop) World Wide Web.  But I didn't realize my filtering isn't working as well as Google's.

My site, whichs runs MMIT to generate alternate WAP content for mobile devices, conditionally filters content between desktop and wireless platforms by using the following basic construct:

if(Request.Browser["IsMobileDevice"] == "false")
{
    // redirect to the main WWW page
    Response.Redirect("
http://www.kuam.com/");
}
else
{
     // display the content formatted for mobile environments
}

Try it for yourself: browse to http://wireless.kuam.com with a variety of devices and platforms (if you can). On a desktop you should get my homepage, and on a Palm OS browser or PocketPC-enabled Microsoft browser you'll likely get the same page, which is much too top-heavy for a smaller phone with bandwidth limitations and screen size constraints.  The upside for my users is that providing they know both URLs, they can selectively browse & bookmark either destination, and not have either page forced upon them.

I figure that I'd need to couple the above code with more in-depth device filters in my app's web.config file.  I wonder how Google's doing it...

Comments

Jeff said:

it doesnt work with my nokia N81 your site didnt redirected.

# July 26, 2008 1:19 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)