Tuesday, May 13, 2008

What types of validation would you use to verify that a user entered a valid ­customer number?

You would use a RequiredFieldValidator and a RegularExpressionValidator. If you have access to a list of expected customer numbers, you could replace the RegularExpressionValidator with a CustomValidator that checked the list.

Why does ASP.NET perform validation on both the client and the server?

Client-side validation helps avoid round-trips to the server. Validating on the client ensures that the data is valid before it is submitted, in most cases. However, because validation might be turned off (or maliciously hacked) on the client, data must be revalidated on the server side. This provides full assurance that the data is valid while avoiding as many round-trips as possible.

What is the main difference between the Button server control and the Button HTML control?

When clicked, the Button server control triggers an ASP.NET Click event procedure on the server. The Button HTML control triggers the event procedure indicated in the button’s onclick attribute, which runs on the client.

What determines the boundaries of a Web application?

IIS determines Web application boundaries by the structure of the application’s virtual folders. A Web application boundary starts in the folder containing the start page of the application, and it ends at the last subordinate folder or when it encounters another start page in a subordinate folder.

How do you preserve persistent data, such as simple variables, in a Web application?

You can preserve data in state variables, such as ApplicationState, SessionState, or ViewState.

Describe the life cycle of a Web application: When are Web forms instantiated and how long do they exist?

A Web application starts with the first request for a resource within the application’s boundaries. Web forms are instantiated when they are requested. They are processed by the server and are abandoned immediately after the server sends its response to the client. A Web application ends after all client sessions end

When can’t you use ASP.NET to create a Web application?

When you are developing for non–Microsoft Windows Web servers, such as Linux/Apache.

How do you restore the default window settings in Visual Studio .NET?

From the Tools menu, choose Options, and then click Reset Window Layout.

What are the two main parts of the .NET Framework?

The common language runtime (CLR).

The .NET Framework class library.

Give two examples of how an ASP.NET Web application is different from a ­traditional Windows application.

Web applications and traditional Windows applications have the following differences:

ASP.NET Web application
Unmanaged Windows application

Local user

Runs under common language runtime using managed code
Runs under Windows using unmanaged code