O'Reilly logo

Special Edition Using Microsoft® Visual Basic® .NET by Jeff Spotts, Brian Siler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing Code Behind a Web Form

In the Web Forms programming model, you have a choice of where to put the VB code; it can reside with the HTML in an .aspx file (as described in Chapter 17, “Using Active Server Pages.NET”), or in a separate .vb file that contains just code. Keeping the code and user interface separate is one of the great features of the Web Forms programming model, so Visual Studio .NET makes this choice for you by creating a webformname .aspx.vb file automatically when you add a new Web form to your project. This separate file is known as the code-behind file, because it contains the code “behind” the Web form interface.

Visual Studio makes the fact that there are two files transparent to the developer; choosing View Code in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required