Chapter 3. Forms

Introduction

Classic ASP developers have become accustomed to certain approaches to performing tasks with forms. The ASP.NET model requires a few changes to these approaches, to say the least.

In particular, one of the toughest things to grow accustomed to is the concept of programming both the server and client sides of an application. Forms are inherently client-side, because that’s where they execute and much of their behavior must be handled in the client browser. Sounds simple enough, but getting forms to do your bidding actually requires you to write server-side code that writes the client-side code to be executed when the page is loaded in the browser. And if that weren’t enough, consider that the client-side code often needs to be written in JavaScript. Add to that the task of managing the nuances of another scripting language, and you begin to feel as though you’re playing 3-D chess.

This chapter provides solutions to many form-related problems that you are likely to encounter in using ASP.NET. By the time you’ve waded through a recipe or two, the client- and server-side maneuvers required ought to begin to seem fairly manageable.

Get ASP.NET Cookbook 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.