Transcript Chapter 1

Introducing Web Developer Tools
• Rapid application development tools
• ASP.NET-compatible web editors
– Visual Studio .NET Professional Edition
– Visual Studio Express
• Freely available by download from Microsoft
• Can download from www.asp.net
1
HTTP
2
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
3
Processing ASP.NET Applications
4
Processing ASP.NET Applications
(continued)
• Web Forms are web pages identified with the file extension
.aspx
• 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
5
Server Controls
6
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
7
Server Controls (continued)
8
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
<input id="Text1" type="text" runat="server"/>
– 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
9
Web Controls
• Web Server controls
– Prefix asp:control name
<asp:Button ID="Button1" runat="server" Text="Show
the message" />
– 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
10
Creating a Web Page Using a Web Editor
11
Using the Postback Process
• Maintaining state – maintain information across
browser requests
• Postback – posting of data back into the form
• Enable Secure Sockets Layer (SSL) protocol using
https://
• Set the EnableViewState property within @Page
directive
<%@ Page EnableViewState="false" %>
12
Summary
• Visual studio Express is a scaled down version of Visual Studio
.NET 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
• 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
13
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 <br> must be closed in the first tag <br /> or
include a closing tag <br></br>
– Elements are case sensitive
– All elements have an opening and closing tag
14
Summary (continued)
• Namespaces are a hierarchical way to organize classes
within the assemblies
• Dynamic Help and IntelliSense help programmers
prevent syntax errors
15