Presentation is loading. Please wait.

Presentation is loading. Please wait.

CIS 375—Web App Dev II ASP.NET 2 Introducing Web Forms.

Similar presentations

Presentation on theme: "CIS 375—Web App Dev II ASP.NET 2 Introducing Web Forms."— Presentation transcript:

1 CIS 375—Web App Dev II ASP.NET 2 Introducing Web Forms

2 2 What is ASP.NET Web Forms? The ASP.NET Web Forms page framework is a scalable common language runtime programming model that can be used on the server to dynamically generate Web pages. The ASP.NET Web Forms framework provides: The ability to create and use reusable UI controls that can encapsulate common functionality and thus reduce the amount of code that a page developer has to write. The ability for developers to cleanly structure their page logic in an orderly fashion (not "spaghetti code"). The ability for development tools to provide strong WYSIWYG design support for pages (existing ASP code is opaque to tools).

3 3 Writing Your First Web Forms Page ASP.NET Web Forms pages are text files with an ______ file name extension. An ASP.NET page can be created by taking an existing HTML file and changing its file name extension to.aspx. VB Intro1.aspx [Run Sample] | [View Source]Run SampleView Source.aspx

4 4 Using ASP Render Blocks ASP.NET provides syntax compatibility with existing ASP pages including support for _________ code render blocks. VB Intro2.aspx [Run Sample] | [View Source]Run SampleView Source Important: Unlike with ASP, the code used within the above blocks is actually compiled--not ___________ using a script engine, resulting in improved performance. ASP.NET page developers can utilize code blocks to dynamically modify HTML output much as they can today with ASP. VB Intro3.aspx [Run Sample] | [View Source]Run SampleView Source interpreted

5 5 Introduction to ASP.NET Server Controls Instead of using code blocks to program dynamic content, ASP.NET page developers can use ASP.NET server controls to program Web pages. Server controls are declared within an.aspx file using custom tags or intrinsic HTML tags that contain a runat=“_______" attribute value. VB Intro4.aspx [Run Sample] | [View Source] | [ads.xml]Run SampleView Sourceads.xml Note also that no _______-side script is required. ASP.NET enables developers to utilize richer custom controls on their pages, such as the control. (see Server Controls)Server Controls VB Intro5.aspx [Run Sample] | [View Source]Run SampleView Source server client

6 6 Handling Server Control Events Each ASP.NET server control is capable of exposing an _______ model containing properties, methods, and events. ASP.NET developers can use this object model to cleanly modify and interact with the page. VB Intro6.aspx [Run Sample] | [View Source]Run SampleView Source This simple sample is functionally equivalent to the "Intro3" sample demonstrated earlier in this section. Note, however, how much cleaner and easier the code is in this new server-control-based version. object

7 7 Using Custom Server Controls ASP.NET ships with ____ built-in server controls that can be used out of the box. See Web Forms Controls ReferenceWeb Forms Controls Reference Developers also can use controls developed by ______-party vendors. The following sample shows a simple calendar control. VB Intro7.aspx [Run Sample] | [View Source] | [Acme.vb]Run SampleView SourceAcme.vb This Calendar control performs "uplevel-like" processing on IE 5.5 (doesn’t require round trips back to the server when doing calendar navigation) and "downlevel" processing on all other browsers. 45 third

8 8 Lists, Data, and Data Binding ASP.NET has a built-in set of data _____ and list controls for UI driven from queries against a __________ or other data source. The following demonstrates how to use the control. VB Intro8.aspx [Run Sample] | [View Source]Run SampleView Source The control enables end users to exactly control the structure and layout of each item within the list (using the ItemTemplate template property). VB Intro10.aspx [Run Sample] | [View Source]Run SampleView Source grid database

9 9 Form Validation Controls 1 ASP.NET provides a set of ___________ server controls to check input forms for errors, and display messages to the user. There are controls for specific types of validation, such as _______ checking or pattern matching, plus a RequiredFieldValidator. The following demonstrates how to use two controls. VB Intro11.aspx [Run Sample] | [View Source]Run SampleView Source validation range

10 10 Form Validation Controls 2 Validation controls have both ________ (validation on the client and on the server) and downlevel client support (only on the server). ASP.NET page developers can check the Page.IsValid property at run time to determine whether all validation server controls on a page are currently valid. This provides a simple way to determine whether or not to proceed with business _______. VB Intro12.aspx [Run Sample] | [View Source]Run SampleView Source uplevel logic

11 11 Code-Behind Web Forms ASP.NET supports two methods of authoring dynamic pages. The first is the method shown in the preceding samples, where the page code is physically declared within the originating ______ file. An alternative approach--known as the code-behind method--enables the page code to be more cleanly separated from the HTML content into an entirely separate file. VB Intro13.aspx [Run Sample] | [View Source] | [Intro13.vb ]Run SampleView SourceIntro13.vb.aspx

12 12 Summary 1. ASP.NET _____ Forms provide an easy and powerful way to build dynamic Web UI. 2. ASP.NET Web Forms pages can target any ________ client (there are no script library or cookie requirements). 3. ASP.NET Web Forms pages provide syntax compatibility with existing _____ pages. 4. ASP.NET _______ controls provide an easy way to encapsulate common functionality. 5. ASP.NET ships with ___ built-in server controls. Developers can also use controls built by third parties. 6. ASP.NET server controls can automatically project both uplevel and ___________ HTML. 7. ASP.NET _________ provide an easy way to customize the look and feel of list server controls. 8. ASP.NET __________ controls provide an easy way to do declarative client or server data validation. Web browser ASP server 45 downlevel templates validation

Download ppt "CIS 375—Web App Dev II ASP.NET 2 Introducing Web Forms."

Similar presentations

Ads by Google