2.4. Practical Tips on Working with Web Forms

Here are some tips for working with Web Forms:

  • Always try to favor Web Forms with Code Behind over those with inline code. Although at first you may not notice a big difference in working with them, as your site and pages start to grow, you'll find that it's easier to work with a page where the code is separated from the markup. Also, when you're working with a team on a web site, Code Behind allows you to work with more than one person on the same file: one developer can work on the design in the .aspx file, while another developer can add code to the aspx.vb or aspx.cs file.

  • Spend some time familiarizing yourself with the different menu items of the Format and Table menus. Most of them generate HTML tags that are inserted into your page. Take a look at the HTML tags and attributes that have been generated for you, and try to change them directly in the code, and through the menus and toolbars. This way, you get a good feel for the various tags available and how they behave.

  • Experiment with links to connect pages in your site. Notice how VWD creates different links depending on the location of the page you are linking to. Chapter 7 deals with linking and the various ways to address pages in your site in much more detail.

Get Beginning ASP.NET 3.5: In C# and VB now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.