WWW Architecture: Client
WWW Architecture: Client
WWW Architecture
PC/Mac/Unix
+ Browser (IE, FireFo
Client
Request:
http://www.msn.com/default.html
HTTP
TCP/IP
Network
Response:
<html></html>
Server
Web Server
Web Technologies
HTTP / HTTPS (URL, GET/POST)
Client-side:
HTML / XHTML (Extensible HyperText Markup
Language)
JavaScript / VBScript (client-side scripting)
Applets / ActiveX controls
Server-side:
PHP
Phython
JSP (Java Server Pages)
ASP (Active Server Pages)
ASP.NET (next generation of ASP)
ASP Architecture
PC/Mac/Unix
+ Browser (IE, FireFo
Client
Request:
http://www.msn.com/default.aspx
HTTP
TCP/IP
Network
Response:
<html></html>
Server
IIS
Server-Side Code
What is server-side
code?
Software that runs
on the server, not
the client
Receives input from
URL parameters
HTML form data
HTTP request
(form data,
HTTP
header data)
HTTP response
HTML, XML
ASP page
(static HTML,
server-side
logic)
WebTime.aspx Example
Lets create our first ASP.NET page using
Visual Studio
1.
2.
3.
4.
5.
6.
XHTML documents
have the root element
html and markup
information about the
document in the head
element.
7
WebTime.aspx
( 2 of 2 )
WebTime.aspx Example
Examining an ASPX File
The Page directives Language attribute specifies
the
code-behind files language.
The CodeFile attribute specifies the code-behind
filename.
When AutoEventWireup is true, ASP.NET
automatically treats a method of name
Page_eventName as an event handler.
When AutoEventWireup is set to false, you specify
event handlers using attributes in the Page
directive just as you would any other web control.
The Inherits attribute (line 4) specifies the class
in the code-behind file from which this ASP.NET
WebTime.aspx Example
The document type declaration, which specifies
the document element name and the PUBLIC URI
for the DTD that defines the XHTML vocabulary.
XHTML documents have the root element html
and markup information about the document in
the head element.
Setting the runat attribute to "server" indicates
that ASP.NET processes the element and its
nested elements and generates the corresponding
XHTML.
The body contains the main content that the
browser displays.
The form that contains our XHTML text and
controls is set to execute on the server, which
WebTime.aspx Example
The ID attribute assigns a name to a control,
used as an identifier in the code-behind file.
The asp: tag prefix indicates that the label
is an ASP.NET web control, not an XHTML
element.
Each web control maps to a corresponding
XHTML element or group of elements.
WebTime.aspx Example
The asp:Label control is written as an
XHTML span element.
A span element contains text with
formatting styles.
This control is processed on the server so
that the server can translate the control
into XHTML.
If this is not supported, the asp:Label
element is written as text to the client.
WebTime.aspx Example
WebTime.aspx Example
How the Code in an ASP.NET Web Page
Executes
16
WebTime.aspx Example
To view this XHTML, select View Source from
the Page menu
) in Internet Explorer (or
View > Page Source if you are using
Firefox).
Nonvisual form components, called hidden
inputs, store data that the user doesnt need
to see.
Attribute method of the form element
specifies the request method (usually get or
post). The action attribute identifies the
resource that will be requested when a form is
submitted.
17