Jason Salas' WebLog

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

Sponsors

ASP.NET sites that kick ass

Pals with blogs

Podcasts I listen to

Suggestion for Whidbey: Page declaration or config-level redirect property for mobile devices

I'm not sure if this is factored into the Whidbey beta feature set already, but keeping with the goal of reducing the total amount of programming code, I think a worthwhile addition would be a property that could be set at the Page declaration level or in a configuration file that would set a URL to redirect requests in the case a page contained content for mobile devices.

For example, the following construct is used all the time as a means of redirecting requests from desktop browsers to mobile pages:

if(Request.Browser[“IsMobileDevice”] == “true“)
{
         // load mobile content
}
else
{
          Response.Redirect(“http://www.mydesktopsite.com“);
}

Perhaps something like this:
<% @Page Language=“C#” RedirectUrlIfNotMobileDevice=“http://www.mydesktopsite.com” %>

or, in web.config:
<mobileDevices RedirectNonMobileDevices=“http://www.mydesktopsite.com“/>

What do you think?

Comments

mike said:

The mobile story in Whidbey uses so-called adaptive rendering; each control has an adapter that can render the markup appropriate to the browser request. This works something like browsercaps, but rather than just set various switches based on the user agent, the control can instiate entirely different classes to render the markup. It's both tons more powerful as well as extensible. (New device? New adapter class.)

Whidbey also introduces device filtering, which you can apply at the property level. For example, you can have default text (maybe terse text for all devices) and override the Text property for desktop browsers with more verbose text.

So these features are in the service of making it substantially easier to create single-source pages that work for many devices. (Rather than having to author MMIT pages separately.) That said, adaptive rendering and filterin aren't going to make the need (or desire) for separate desktop and device pages go away altogether.
# March 27, 2004 12:43 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)