Download presentation
Presentation is loading. Please wait.
1
ASP.NET 2.0 Chapter 1 Introduction to Web Programming
2
ASP.NET 2.0, Third Edition2 Objectives
3
ASP.NET 2.0, Third Edition3 Introducing Web Developer Tools Rapid application development tools ASP.NET-compatible web editors –Visual Studio.NET Professional Edition –Visual Web Developer Express (VWD) Freely available by download from Microsoft Can download from www.asp.net
4
ASP.NET 2.0, Third Edition4 Exploring Visual Web Editors
5
ASP.NET 2.0, Third Edition5 Exploring the Individual Windows
6
ASP.NET 2.0, Third Edition6 Create a New Web Application
7
ASP.NET 2.0, Third Edition7 Create a New Web Application (continued)
8
ASP.NET 2.0, Third Edition8 Introduction to HTML
9
ASP.NET 2.0, Third Edition9 The Fundamentals of Tags and Attributes There are two basic parts to an HTML tag: the opening tag and the closing tag; they are always enclosed within angle brackets (<>). – Course Technology –The tag tells the browser to bold the subsequent text until the browser finds a closing tag These attributes provide a means of altering the tag in some way The id attribute is used to provide a unique identifier for the tag within that document Standards are maintained by the World Wide Web Consortium (W3C)
10
ASP.NET 2.0, Third Edition10 HTML Structure All tags nested within the (html> ) tags Heading Section identified by ( ) –Title tags ( ) identify the page name in the title bar, in the history list, and in the favorites list within the browser application –Style sheets within the tags or external linked style sheets format the contents of the page –Meta tag ( ) can be used to force the browser to identify keywords and other global values, reload the page, and identify the character encoding scheme
11
ASP.NET 2.0, Third Edition11 HTML Structure (continued) Body Section identified by ( ) –The bgColor attribute is used to change the color of the background –Color value can also be identified by the hexadecimal number associated with the color
12
ASP.NET 2.0, Third Edition12 HTML Structure (continued)
13
ASP.NET 2.0, Third Edition13 Tags that Contain or Format Text Paragraph tags ( ) include carriage return Blockquote tags ( ) – indent text Line break tag ( ) includes carriage return; no content Span tags ( ) – inline Div tags ( ) – block tag; includes carriage return Bold ( ), italic ( ), and underline ( ) Horizontal line ( ) Boolean attributes – no value assigned
14
ASP.NET 2.0, Third Edition14 Tags for Elements Other than Pure Text Table tags ( ) –Attributes set table width, height, border, background color and image Table row tags ( ) define the row Table cell tags ( ) define the cell Table heading cell tags ( ) display contents bolded Table heading, body, footer tags (,, ) identify table header, body, and footer sections, respectively Caption tag ( ) Colgroup tags ( ) – parent tags for column tags ( )
15
ASP.NET 2.0, Third Edition15 Tags for Elements Other than Pure Text (continued) Form tags ( ) contain elements, such as text boxes, radio buttons, check boxes, and drop-down lists Unordered list tags ( </ul) Ordered list tags ( </ol) –List item tags ( ) Image tag ( ) – graphic image Anchor tags ( ) – creates a hyperlink Displayed content goes here. –Bookmarks specify a location within a web page Named markup represents a character entity within the web page –Ampersand (&) represented by & –Apostrophe (‘) represented by '
16
ASP.NET 2.0, Third Edition16 Tags for Elements Other than Pure Text (continued)
17
ASP.NET 2.0, Third Edition17 Create a New Web Page with a Web Editor
18
ASP.NET 2.0, Third Edition18 Create a New Web Page with a Web Editor (continued)
19
ASP.NET 2.0, Third Edition19 Create a New Web Page with a Web Editor (continued)
20
ASP.NET 2.0, Third Edition20 Create a New Web Page with a Web Editor (continued)
21
ASP.NET 2.0, Third Edition21 Create a New Web Page with a Web Editor (continued)
22
ASP.NET 2.0, Third Edition22 Create a New Web Page with a Web Editor (continued)
23
ASP.NET 2.0, Third Edition23 Introduction to XML XML Standards –Extensible Markup Language (XML) –XML Document Object Model (DOM) – a standard language-neutral interface for manipulating XML –XML parser – to read & display XML documents
24
ASP.NET 2.0, Third Edition24 Introduction to XML (continued)
25
ASP.NET 2.0, Third Edition25 XML Rules Well-formed documents follow XML standards –All tags must be nested within the root node –Case sensitive –Must nest in specific order –Container element is an element in which other elements can nest –XML declaration specifies the version of XML –Characters not supported (<>’ “ &)
26
ASP.NET 2.0, Third Edition26 XML Rules (continued)
27
ASP.NET 2.0, Third Edition27 Markup Validation of XML Documents XML documents identify a set of rules, or namespace, associated with the document called a schema Schemas define the structure, content, and semantics of XML documents written in: –Document type definition (DTD) Doctype declaration <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> –XML schema define structure elements as a typed dataset xmlns attribute of the root node identifies the XML schema
28
ASP.NET 2.0, Third Edition28 Markup Validation of XML Documents (continued)
29
ASP.NET 2.0, Third Edition29 Creating and Validating XML Documents in the XML Designer
30
ASP.NET 2.0, Third Edition30 Creating and Validating XML Documents in the XML Designer (continued)
31
ASP.NET 2.0, Third Edition31 Web Site Accessibility Americans with Disabilities Act (ADA), California Online Privacy Protection Act (COPPA), Data Protection Act, Disability Discrimination Act –U.S. government's Section 508 –UK's Disability Discrimination Act W3C Web Accessibility Initiative (WAI) provides Web Content Accessibility Guidelines (WCAG) –Blindness, low vision, color deficit or distortions, deafness and hearing loss, learning disabilities, paralysis, and photo sensitive epilepsy Bobby – online accessibility validation
32
ASP.NET 2.0, Third Edition32 Introduction to ASP.NET Server Programming Client-server programming – client applications to communicate with server applications Dynamic web application interacts with application in ways that change the appearance or content –Shopping carts, membership databases, online catalogs, personalized web sites Limitations of client-side scripting alone are browser dependency and security
33
ASP.NET 2.0, Third Edition33 Processing ASP.NET Applications
34
ASP.NET 2.0, Third Edition34 Processing ASP.NET Applications (continued) Web Forms are web pages identified with the file extension.aspx Assembly contains language- and computer-independent representation of code called Microsoft Intermediate Language (MSIL) ASP.NET engine dynamically compiles the assembly and translates into computer-specific instructions HTML output sent back to the browser Namespaces are a hierarchical way to organize base classes –System.Web.UI.HTMLControl (HTMLControl class) properties and methods common to all HTML server controls
35
ASP.NET 2.0, Third Edition35 Server Controls
36
ASP.NET 2.0, Third Edition36 Server Controls (continued) Server controls generate HTML tags, JavaScript, and Dynamic HTML (DHTML) output compatible with the browser Label, text box, and button controls generate a hidden input field named __EVENTVALIDATION __VIEWSTATE and __EVENTVALIDATION contain information about the controls __doPostBack JavaScript passes the control id and arguments with __EVENTTARGET and __EVENTARGUMENT hidden fields
37
ASP.NET 2.0, Third Edition37 Server Controls (continued)
38
ASP.NET 2.0, Third Edition38 HTML Tags and HTML Controls HTML Server controls –Transform the HTML tag into HTML Server control Runat property is set to server; set ID property –Properties assigned values in the Properties window, opening tag, or server programming code –Generate HTML sent to the browser –Create server-side programs that interact with the controls with no JavaScript required
39
ASP.NET 2.0, Third Edition39 Web Controls Web Server controls –Prefix asp:control name –Different properties than HTML controls Message1.InnerHTML = "Product 1" Message2.Text = "Product 2" –Set properties in markup or programmatically MyControl.BorderColor = System.Drawing.Color.Green
40
ASP.NET 2.0, Third Edition40 Creating a Web Page Using a Web Editor
41
ASP.NET 2.0, Third Edition41 Using the Postback Process Maintaining state – maintain information across browser requests Postback – posting of data back into the form __VIEWSTATE encoded string contains information required to maintain the form data across multiple page requests Enable Secure Sockets Layer (SSL) protocol using https:// Set the EnableViewState property within @Page directive
42
ASP.NET 2.0, Third Edition42 Help Resource
43
ASP.NET 2.0, Third Edition43 Summary Visual Web Developer Express is a scaled down version of Visual Studio.NET 2005 and is used to create ASP.NET applications Solution Explorer window allows you to manage all of your files Set object properties in code manually or in the Properties window Toolbox contains commonly used controls, organized into tabs HTML is a markup language that uses tags to identify how to format and present the content; web pages created with HTML can end in.htm or.html Two parts to a web page are the head and body Forms collect information from the visitor; form elements include text boxes, check boxes, and drop-down lists Create HTML code in HTML view, or Design view
44
ASP.NET 2.0, Third Edition44 Summary (continued) Web Forms build dynamic web pages using new server-side controls that end in.aspx Enhance the user interface and increase interactivity HTML controls runat attribute set to server Server controls create output for the browser XHTML is a version of HTML that is XML-compliant XML files formatted with CSS or XSLT stylesheets XML files must be well formed –One root element in any XML document –Tags such as must be closed in the first tag or include a closing tag –Elements are case sensitive –All elements have an opening and closing tag
45
ASP.NET 2.0, Third Edition45 Summary (continued) XML schema is a set of rules to define document format and structure of the data Validation tools are used to verify that the XML code is compliant with the schema Web Content Accessibility Guidelines (WCAG) address broad accessibility issues related to web access and standards Namespaces are a hierarchical way to organize classes within the assemblies Dynamic Help and IntelliSense help programmers prevent syntax errors
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.