After more googling, I discovered that the MobileCapabilities are
determined from the
%WINDOWS%\Microsoft.NET\Framework\%FRAMEWORK_VERSI ON%\CONFIG\Machine.config.
Here are some good links that discuss the issue:
http://www.hanselman.com/blog/Making...leDevices.aspx
http://www.codeproject.com/aspnet/browsercaps.asp
http://www.slingfive.com/pages/code/browserCaps/ (IE ONLY)
For the schema of the BrowserCaps section, see
http://msdn.microsoft.com/library/de...apssection.asp
There's a browsers folder inside CONFIG that contains .browser files
that try to cover the entire gamut of browsers. However, the config
files are missing most unique device models (but seem to include most
manufacturers), defaulting to some primitive capabilities. For example,
my K750i returns false IsColor, and under-valued screen res.
I couldn't find the schema of the .browser files, nor find an obvious
link between machine.config/web.config and the browser files.
These browser config files need updating for new devices.
Does anyone know where I could buy ASP.NET browser config files for our
projects? Or, must we generate them ourselves from device trial/error.
The only real solution I can think of is to parse the RDF in the
X_WAP_PROFILE request header field and generate per USER_AGENT browser
configurations. There still needs to manual tweaking and merging for
capabilities that aren't explicitly specified in the profile RDF.
This should be part of ASP.NET...or a documented missing feature..
IMHO, this limitation constraints the usefulness of ASP.NET Mobile.
Next time, I may even try and avoid ASP.NET mobile entirely for mass
market sites.
PS: I hope someone from MS reads this, because this is pretty important
to get ASP.NET working ubiquitously on mobile browsers.
-Vijay
VijayS wrote:
> Howdy,
>
> For the past two weeks, I've been playing around and implementing a
> mobile web site using the ASP.NET 2 Mobile UI Controls (in
> System.Web.UI.WebControls namespace).
>
> When trying to read browser capabilities by casting Request.Browser to
> MobileCapabilities, common attributes like IsColor, ScreenPixelWidth,
> ScreenPixelHeight are often wrong. I've tried on a variety of color
> mobile devices and IsColor always returns false...
>
> Something is strange here, and I'm not sure what MS is doing to
> determine the MobileCaps.
>
> Has this been a problem for anyone else?
>
> I've built WAP pages before in JSP that read the UA-Profile from the
> HTTP Request header, fetch the XML URI therein and parse it for the
> true and accurate MobileCapabilities.
>
> Have MS completely forgotten about UA-Prof on mobiles?
>
> -Vijay