There are several different ways to target multiple devices such as browsers, PDAs, and phones in the .NET platform including the Mobile Internet Toolkit and .NET Smart Device Extensions. This sample application demonstrates how to write a custom ASP.NET server control that can target a variety of devices using XML and XSLT.
The server control is called MultiDeviceTransform and is simple to use, yet capable of more advanced tasks as needed by an application such as passing parameters to XSLT stylesheets and using a variety of XML sources. For example, the control can transform static XML documents as well as XML data obtained from the following sources:
- XmlDocument Class
- XmlTextReader Class
- DataSet Class
- SQL 2000 HTTP Queries
- SQL 2000 Template Queries
- SQL 2000 EXPLICIT Queries
Using the control is as simple as adding a TagPrefix, Namespace, and Assembly reference to an ASP.NET page along with the control-specific code.
Configuration information for "uplevel" and "downlevel" browsers as well as different devices such as PDAs and Web-enabled phones is stored in a configuration file called device.config. The MultiDeviceTransform server control code is available in both C# and VB.NET.
|