0% found this document useful (0 votes)
32 views17 pages

WWW Architecture: Client

The document describes the architecture of web technologies like the World Wide Web and ASP.NET. It includes diagrams showing how a client's browser makes an HTTP request to a web server, which then returns an HTML response. It also summarizes common web technologies like HTML, CSS, JavaScript, and server-side scripts like PHP, Python, JSP and ASP.NET. An example ASP.NET application is provided that displays the current time on a web page using a code-behind model.

Uploaded by

rajat1020
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views17 pages

WWW Architecture: Client

The document describes the architecture of web technologies like the World Wide Web and ASP.NET. It includes diagrams showing how a client's browser makes an HTTP request to a web server, which then returns an HTML response. It also summarizes common web technologies like HTML, CSS, JavaScript, and server-side scripts like PHP, Python, JSP and ASP.NET. An example ASP.NET application is provided that displays the current time on a web page using a code-behind model.

Uploaded by

rajat1020
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 17

Internet Technologies

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

(Internet Information Server

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

Can access serverside databases, email servers, files,


mainframes, etc.
Dynamically builds
a custom HTML
response

HTTP request
(form data,
HTTP
header data)

HTTP response
HTML, XML

ASP page
(static HTML,
server-side
logic)

ASP.NET Overview and


Features

ASP.NET provides services to allow the


creation, deployment, and execution of
Web Applications and Web Services
Web Applications are built using Web Forms
Web Forms are designed to make building
web-based applications as easy as building
Visual Basic applications
Built on .NET Framework: any .NET
programming language can be used (C#,
Visual Basic)
Complete object model
Separation of code and UI
Maintains page state
Session management
Caching, Debugging, Extensibility

WebTime.aspx Example
Lets create our first ASP.NET page using
Visual Studio
1.
2.
3.
4.
5.
6.

Modify title of the page


Add a heading <h2>
Look at the page in Design and Split modes
Add a Label control from the Toolbox
Change ID of the Label control
Change some physical properties of the
Label control
7. Go to WebTime.aspx.cs file and add
Page_Init function to set Text property of
the Label control

Visual Studio generates the markup


shown when you create the GUI.
WebTime.aspx ( 1 of 2 )
ASP.NET comments
begin with <%-- and
terminate with --%>,
and can span multiple
lines.
The Page directive
specifies information
needed by ASP.NET
to process this file.
The document type
declaration, which specifies
the document element name
and the PUBLIC URI for the
DTD that defines the
XHTML vocabulary.

The form that contains our


XHTML text and controls is set to
execute on the server, which
generates equivalent XHTML.

The body contains


the main content
that the browser
displays.

ASPX file that displays the web servers


time.

XHTML documents
have the root element
html and markup
information about the
document in the head
element.
7

WebTime.aspx
( 2 of 2 )

The asp: tag prefix


indicates that the
label is an ASP.NET
web control, not an
XHTML element.

Markup for a label


web control.

In an ASPX file a directive is delimited by <%@ and


%>.
ASPX file that displays the web servers time. (Part 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.

The code-behind file


(WebTime.aspx.cs)
The Page_Init
method handles the
pages Init event,
which indicates that
the page is ready to
be initialized.
Retrieve the current
time and formats it
as hh:mm:ss.

Code-behind file for a page that displays


the web servers time. (Part 1 of 2.)

WebTime.aspx Example Run

The Page_Init method handles the pages


Init event, which indicates that the page is
ready to be initialized.

WebTime.aspx Example

Relationship Between an ASPX File and


a
Code Behind File
The code-behind file inherits from Page, which
defines the general functionality of a web page.
The code-behind file contains a partial class.
ASP.NET generates another partial class that
defines the remainder of that class, based on the
markup in the ASPX file.
The first time the web page is requested, this
class is compiled, and an instance is created.
This instance represents our pageit creates the
XHTML that is sent to the client.
Once an instance of the web page has been
created, multiple clients can use it to access the
pageno recompilation is necessary.
15

WebTime.aspx Example
How the Code in an ASP.NET Web Page
Executes

When an instance of the page is created, the


PreInit
event occurs first, invoking method
Page_PreInit, which can be used to set a pages theme.
The Init event occurs next, invoking method Page_Init,
which is used to initialize objects and other aspects of
the page.

Next, the Load event occurs, and the Page_Load


event handler executes.
The Init event is raised only once (when the page is first
requested).
The Load event is raised with every request.

The page then processes any events that are


generated by the pages controls.PreRender-the brief
moment before the page is
Displayed to the user as HTML.

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

You might also like