Article
ASP.NET Form Processing Basics
In my first article, Getting Started with ASP.NET (which you should read first if you haven't already), I introduced you to the Microsoft .NET platform, walked you through the installation of the .NET Framework, and showed you how to create a very basic ASP.NET Web page.
In this article, we'll take the next step on your road to ASP.NET expertise. I'll demonstrate with an example how ASP.NET can be used to process a simple form submission. As before, all examples will be presented both in C# and in VB.NET.
A Personalized Greeting
Here's the finished example (hellothere-cs.aspx) from the previous article in this series:
<%@ Page Language="C#" %>
<html>
<head>
<title>My First ASP.NET Page</title>
<script runat="server">
protected void Page_Load(Object Source, EventArgs E)
{
TimeLabel.Text = DateTime.Now.ToString();
}
</script>
</head>
<body>
<p>Hello there!</p>
<p>The time is now: <asp:label runat="server" id="TimeLabel" /></p>
</body>
</html>
As you'll recall, this simple page displayed the current time according to the server on which it was running:

While effective, you must admit that the greeting on this page is a little impersonal. Wouldn't it be nice if the page greeted each user by name?
Of course, for this to happen we need to prompt each user for his or her name. To do that, we'll need a form...
Kevin began developing for the Web in 1995 and is a highly respected technical author. He wrote