How to Make Rich ASP.NET Controls work in the Blackberry
Saturday, October 17, 2009 1:53:00 AM
Microsoft ASP.NET version 2.0 and above includes support for mobile browsers right out of the box. However, many of the features/behaviors included in the adaptive control architecture do not automatically show up for the Blackberry. This is because ASP.NET relies on a browser configuration file to truly render many of the more complex features. This configuration file for the Blackberry is not installed as a part of an ASP.NET or IIS install. Thus, until the browser configuration file is created, many behaviors, when used with the BlackBerry Browser, still support HTML only. This means that until the browser configuration file is created, the ASP.NET controls do not support JavaScript(r), ECMAScript, or cascading style sheets (CSS).
To Create and "install" the BlackBerry.browser configuration file, do the following:
Create a BlackBerry.browser configuration file:
In Microsoft .NET 2.0, browser support is managed from within the application or by the defaults that are installed with the framework.
Here is a sample BlackBerry.browser configuration file that will support the feature set created in Task 1.
1. Create a file called BlackBerry.browser.
2. Copy the following text into the file:
<browsers>
<browser id="BlackBerry" parentID="Default">
<identification>
<userAgent match="BlackBerry(?'model'\d+)/(?'version'((?'major'\d+).(?'minor'\d+).(?'other'\d+)))" />
</identification>
<capabilities>
<capability name="browser" value="BlackBerry" />
<capability name="isMobileDevice" value="true" />
<capability name="javascript" value="true" />
<capability name="ecmascriptversion" value="1.3" />
<capability name="version" value="${version}" />
<capability name="majorVersion" value="${major}" />
<capability name="minorVersion" value="${minor}" />
<capability name="supportsCss" value="true" />
<capability name="frames" value="false" />
<capability name="cookies" value="true" />
</capabilities>
</browser>
</browsers>
1. Save the file in the Browsers directory (e.g. C:\\WINDOWS\Microsoft.NET\Framework\V2.0.50727\CONFIG\Browsers)
Register the new browser configurations with Microsoft ASP.NET
To use the Microsoft .NET 2.0 adaptive control architecture with the BlackBerry Browser, the new browser configuration must be registered.
To perform the registration, use the command line tool aspnet_regbrowsers.exe. This tool will create an assembly based on the information in the *.browser files and will install the assembly into the global assembly cache. Additional information on this tool can be found at the Microsoft Developer Network<http://msdn2.microsoft.com/en-us/library/ms229858%28VS.80%29.aspx> web site.
From a command prompt, enter the path to aspnet_regbrowsers.exe and use the -i switch to register the browser configurations. For example, C:\\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regbrowsers.exe -i
You should now be able to use Microsoft .NET 2.0 adaptive control architecture with the BlackBerry Browser.
http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800878/800733/How_To_-_Configure_.NET_2.0_for_BlackBerry_Browser_support?nodeid=1365369&vernum=0