ASP.NET is Multi-device and Multi-browser
Perhaps the biggest hurdle web
developers face, from a user interface perspective, is the accessibility of the
HTML output of our applications in various browsing environments. Should we
develop our applications to an HTML 4.01 standard? 3.2? Something else? This
problem, fueled by the browser companies, has plagued developers since the
advent of varying support for World Wide Web Consortium standardization.
Chances
are if you've ever used JavaScript or VBScript as a client form-validation
mechanism, you've run into scores of snags with users using lower-level
browsers who have problems viewing your interfaces. The result is increasing
frustration with your choice of HTML editor, competition in the ranks of
software manufacturers, and even more recently developments such as the Web
Standards Project, which encouraged the use of aggressive tactics designed to
force users into downloading more recent browsers with greater degrees of W3C
support.
Microsoft
has been surprisingly helpful in this endeavor. The ASP.NET architecture
contains the ability to dynamically determine the client, and to make
adjustments to how page rendering will perform on the fly. Whether your users'
clients are the most recently distributed versions or a few versions back,
ASP.NET pages will render appropriately and function universally. During a
page-rendering process, ASP.NET's behind-the-scenes browser detection and
output generation features determine the browser's functionality and adjust how
the HTML will eventually be transmitted. In newer, more advanced clients, the
HTML output generated by ASP.NET contains embedded DHTML and JavaScript, to be
used for state maintenance, validation, and navigation functions. For older,
less "talented" clients, HTML 3.2 standards would be applied. Though
these down-level browsers may receive HTML that requires more trips to the
server, the user experience is virtually identical.
Form
validation scripts, for example, are a frequent headache for most web
developers; in order to properly use any data passed from an HTML form, it's
imperative that client-side validation scripts be created to check the data
before posting it to the server. By using the included required field validator
control with text-entry boxes generated by the server, we can leverage the
automatic creation of these complicated scripts. Take the following ASPX code
as an example:
<form id="Form1" method="post"
runat="server">
<table>
<tr>
<td>Enter your
Name:</td>
<td><asp:TextBox id="TextBox1"
runat="server"></asp:TextBox></td>
<td>
<asp:RequiredFieldValidator id="RequiredFieldValidator1"
runat="server"
ErrorMessage="Name
is Required!" ControlToValidate="TextBox1"/>
</td>
</tr>
<tr>
<td
colspan="3">
<asp:Button
id="Button1" runat="server" Text="Button" />
</td>
</tr>
</table>
</form>
This
page will function in nearly any browser that supports JavaScript and HTML
forms. For you, the developer who's struggling to develop and deploy a
universally accessible application, this means less work, fewer headaches, and
a much faster development process.
As you
can see, Microsoft has gone above and beyond the call of duty when it comes to
providing easy, reusable controls to generate universally accessible HTML code.
But it
gets even better!
By
using special controls and extensions in the ASP.NET framework, you can easily
deploy applications that are to be viewed using more specialized browsers, such
as mobile phones, PDAs, and other similar devices. By utilizing the namespaces
and extensibility of the various .NET tools Microsoft has slated to release,
you are free to develop applications that result in HTML, XML, even WML and
HDML for mobile phones.
Microsoft provides the Mobile Internet Toolkit for
mobile device application development. This toolkit contains additional
components and controls geared towards the development of mobile Internet
applications. This free download can be found at http://msdn.microsoft.com/vstudio/device/mitdefault.asp.
Buy Fast Track ASP.NET here
© Copyright 2002 Wrox Press
These chapter is written by Brady Gaster, Marco Bellinaso & Kevin Hoffman
and taken from "Fast Track ASP.NET" published by Wrox Press Limited in June 2002; ISBN 1861007191; copyright © Wrox Press Limited 2002; all rights reserved.
No part of these chapters may be reproduced, stored in a retrieval system or transmitted in any form or by any means -- electronic, electrostatic, mechanical, photocopying, recording or otherwise -- without the prior written permission of the publisher, except in the case of brief quotations embodied in critical articles or reviews.
|
|