Article

Home » Server-side Coding » ASP & .NET Tutorials » ASP.NET Form Processing Basics

About the Author

Kevin Yank

author_kev1 Kevin began developing for the Web in 1995 and is a highly respected technical author. He wrote Build your own Database Driven Website using PHP and MySQL, a practical step-by-step guide published by SitePoint, and he's co-author of the SitePoint Tech Times, a bi-weekly newsletter for technically-minded web developers. Kev believes that any good webmaster should have seen at least one episode of MacGyver.

View all articles by Kevin Yank...

ASP.NET Form Processing Basics

By Kevin Yank

July 2nd, 2002

Reader Rating: 9

Page: 1 2 3 4 Next

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:

My First ASP.NET Page

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?

Personalised Greeting

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...

If you liked this article, share the love:
Print-Friendly Version Suggest an Article

Sponsored Links