webdeveloper.earthweb.com/webjs/article.php/982451
|
By Jeff Prosise February 27, 2002 From Programming Microsoft .NET. Copyright 2002, Jeff Prosise. Reproduced by permission of Microsoft Press. All rights reserved. Authors note: The following is extracted from the book Programming Microsoft .NET by Jeff Prosise (Microsoft Press, 2002, ISBN: 0-7356-1376-1) The book teaches readers how to take advantage of the .NET Framework. It covers the key programming models embodied in the .NET Framework, including Windows forms, Web forms, and XML Web services. The Web Forms Programming ModelEditor's Note: This article continues Chapter 5, "Web Forms." The first part of this chapter can be obtain from HERE.Calc.aspx demonstrates three important principles of the Web Forms programming model:
You probably noticed the RunAt="server" attributes sprinkled throughout Calc.aspx. RunAt="server" is the key that unlocks the door to the magic of Web forms; it signals ASP.NET to "execute" the tag rather than treat it as static HTML. RunAt="server" is not optional. It must be used in every tag that ASP.NET is to process, including the <form> tag that marks the beginning of a form containing server controls. Web ControlsTextBox, Button, and Label are server controls. They're also examples of Web controls-server controls defined in the FCL's System.Web.UI.WebControls namespace. The Web controls family includes almost 30 different control types that you can use in ASP.NET Web forms. The following table lists the Web controls provided in version 1.0 of the .NET Framework class library: Web Controls
Some Web controls are simple devices that produce equally simple HTML. Others produce more complex HTML, and some even return client-side script. Calendar controls, for example, emit a rich mixture of HTML and JavaScript. It's not easy to add a calendar to a Web page by hand (especially if you want dates in the calendar to be clickable), but calendars are no big deal in Web forms: you simply include an <asp:Calendar> tag in an ASPX file. DataGrid is another example of a sophisticated control type. One DataGrid control can replace reams of old ASP code that queries a database and returns the results in a richly formatted HTML table. You'll learn all about the DataGrid and other Web controls in the next chapter. |
| Go to page: 1 2 3 4 5 Next |
|
*JavaScript is a registered trademark of Sun Microsystems, Inc.
|