Server-Side Development

ASP.NET offers three main server-side development models for building Web applications:

1. Web Forms
2. ASP.NET MVC (or just MVC for short)
3. Web Pages

Web Forms was the original Web development model in .NET and is now in version 4.5. MVC was first released in March 2009 and is now in version 4. Web Pages (and the associated Razor view engine) was first released in January 2011 and is now in version 2.

Web Forms

The goal of Web Forms is to make the Web development experience as close to the Windows Forms (or Classic VB) development experience as possible. You build pages by dragging and dropping controls on a design surface, you set properties of those controls though the Properties window, and you add event handlers by double-clicking the controls. This gives separation between the code generated by the designer and the code you write.

Following the premise that the most effective way to learn a new technology is to use it, you'll now walk through a sample application of the core features of Web Forms. You can follow along with the instructions below or you can examine the project included with the code downloads for the book.

Open Visual Studio and select File ⇒ New ⇒ Project. In the New Project dialog, select the ASP.NET Web Forms Application template, set the Name to WebFormsDemo, and click the OK button (see Figure 14.1).

Figure 14.1 New Web Forms project

The project created by the template is a working Web application containing several sample ...

Get Professional Visual Basic 2012 and .NET 4.5 Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.