 |
 |
 |
|
|
|
Links
www.asp.net
A brilliant collection of interactive demos and tutorials for the ASP.NET beginner
|
|
|
 |
 |
An Example ASP.NET Web Form for Data Input
Find out how ASP.NET Web Forms helps us with the tedious task of processing HTML forms
|
Background
We all know what HTML forms are, right? The majority of web sites contain "forms" for users to enter information... anything from
simply subscribing to a newsletter, to booking a flight, to on-line share dealing.
We also know that ASP.NET is a server side technology used to create web pages and web services too.
Under normal circumstances we can think of each web page as an ASP web form (or physically a '.aspx' file) on the server. This page
has the extension '.aspx' because it is a web form served by ASP.NET. A web form does not have to contain a HTML form - only
those pages that need user input of some kind contain HTML forms. However, if we do want to include a HTML form in our aspx web form
page, then ASP.NET can help the developer immensely..
Normally, as in ASP version 3 and in other server side programming models, HTML forms are really tedious
to handle. Imagine any scenario where the user must enter lots of information in a web page. What happens if the user presses
'submit', but has missed out an essential field, or has typed something invalid according to the business rules on the server
(hey, we can't insure you if your hobbies include BASE jumping)? Well the whole page must be rebuilt, alerting the user to what
has gone wrong, and hopefully not loosing the previously entered information that was ok. This task was up to the server side
programmer to write. The latest version of ASP, ASP.NET, now automates this process, so the programmer no longer has to worry
about writing code to remember all the entry fields between submits (browser to server 'round trips').
Here is an example HTML form hosted by this ASP.NET web form... enter any rubbish you like in any of the
following fields and then press the 'submit' button... In this simple example ASP.NET serves the same page back,
with all the fields filled in how you entered them, and in addition marking which fields have changed.
Conclusion - A Coding Nightmare Relieved
Think how many millions of lines of code that thousands of programmers independently have had to write, and still do write,
to do this same old routine task of form handling. Roll-on ASP.NET I say!.. I would though, I'm a developer!
However, I do think that there are benefits to be gained all-around... i.e. Concentration of
resources on the business processes that matter, quicker project development times,
increased team motivation, and ultimately cost savings.
The next article presents an insight in to
web forms from the developer's perspective.
|
 |
 |
|
|
| © Copyright 2003 Mark V Williamson |