- Trained on our vast library of engineering resources.
.NET Mobile Web Developer's Guide

A Quick Look at ASP.NET

Before we look into the technical details of working with ASP.NET, let s consider a typical situation when writing a Web application with ASP. As you are probably aware, HTTP is a stateless protocol. Although being stateless has its benefits, such as reducing the resources on the server side, it often poses headaches for Web developers. The following example illustrates one of the problems with statelessness commonly faced by ASP developers. In this example, you have a form and you need users to fill it in and submit it for processing. The form may look like Figure 3.1.


Figure 3.1: Web Application Using ASP

When you click Submit, you print a message on the same page, as shown in Figure 3.2.


Figure 3.2: State Is Lost When the ASP Page Is Submitted

Notice that the name in the text box is gone and the item in the selection list has been reset to the first item. Figure 3.3 shows the ASP code for the sample Web application.

Tell us about yourself:
Name
Which part of the world are you from? <% if Request.Form("userName")<>""then Response.Write "Welcome to ASP.NET, " & Request.Form("userName") & " (from " & Request.Form("partOfWorld") & ")!" end if<a name="244"></a><a name="beginpage.9EB7227B-2432-4DFE-A31F-5B59430EB97C"></a>%>

Figure 3.3: Eg1.asp

To ensure that the name and selection item remains selected after submission, you must modify the codes as...

UNLIMITED FREE ACCESS TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Application Service Providers
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.