What is a dynamic web document?One or more of the following: A web document with information that
is not static or not hard-coded by the webmaster (a document that is dynamically generated by the server in response to a query)
Something on the web page moves or changes (animated)
The web page may respond to user input
It is DHTML!!! — A combination of HTML, style sheets and scripts that allows documents to be animated
DHTML – Dynamic HTML“DHTML combines HTML 4, the
DOM, scripting and CSS to create dynamic, interactive pages not possible with static HTML or paper-based documents.”
Common examples of DHTML: Rollovers: Information
changes in response to user actions.
Show/Hide: Information appears (shows) or disappears (hides) in response to user actions.
Animation: Information moves about the page, automatically or in response to user actions.
Source: http://www.xhtmlchef.com/forehelp_08-01.asp
Rollover Image:
Show / Hide
Animation
Two Sides to DHTMLClient-side
DHTML is usually processed on this side for fastest execution on local machine memory. Good for DHTML that does not involve the Server and helps relieve the burden on doing the same task on Servers.
Often form input error checking is handled here before information is passed on to the server.
Languages: ECMAScript (JavaScript, JScript), VBScript
Server-side
Server-side DHTML effects such as personalization and session configurations are processed here.
Often a database is being used to retrieve information to be displayed in a dynamically generated webpage that is produced by the server and sent to the client for presentation.
Languages: ASP, JSP
Client-Side DHTML
Most commonly used language for client-side DHTML is JavaScript.
Demo:Making your tables sortable.
http://www.kryogenix.org/code/browser/sorttable/
Server-Side DHTML Concept
Server-Side DHTML usually involves the server creating a dynamically generated web page that is data driven.
The html page is a result of a server side script that generates the html.
This page is dynamically generated at the client’s request, thus getting unique html page results based on the queries submitted. Having a static webpage for every possible query is not practical, especially if the data in the database changes!
Client(Browser)
Server(Web server)
URL request
html page htmlDatabase
Table
Basic Sequence of Data Driven Web Pages
1. User clicks on a JSP, ASP, or ASP .NET file link
2. Client requests this file from server
3. Server executes this file4. This file generates the html page
using the database data5. The server sends this new html
page to client6. The client displays this html page
ASP & ASP .NET
Active Server Pages (ASP)
Two styles of ASP:
1) Old style ASP scriptletsLook like this:
2) ASP .NETThere is a separation of html and code, but you still have the option of using ASP scriptlets. The separate code can be C#, Visual Basic .NET, or any other programming language.
ASP is a program that runs inside Internet Information Systems (IIS), and it is a Microsoft Technology
An ASP file (extension .asp) is html with embedded server scripts
ASP .NET file extension is .aspx
ASP is shipped with VBScript and JScript (Microsoft's implementation of JavaScript). If you want to script in another language, like PERL, REXX, or Python, you will have to install script engines for them.
Also, because the scripts are executed on the server, the browser that displays the ASP file does not need to support scripting at all!
<%@ language="javascript"%> <html><body>
<% Response.Write("Hello World!")%>
</body></html>
ASP: HTML + ScriptServer-script tags: <% code %> <%= expression %>
Tag contents are executed and replaced with script’s output
script.asp:<%@ Page language="c#” %><html><body>The time is <%= System.Date.Now.ToString() %><% if(System.Date.Now < “12:00pm”){ %>
<p>Good morning<% }else{ %>
<p>Good afternoon<% } %></body></html>
Client receives:<html><body>The time is 2:03pm<p>Good afternoon</body></html>
This is why if the user tries to View Source in web browser, you do not see any of the asp source code because it got replaced with html and text.
At page request, Server executes script
<%= expr %> Replaced with value of expr
<% code %> Executes code
ASP .NET: Use Separate Code.aspx = html with asp tags, .aspx.cs = associated C# codeAlso supports old ASP-style embedded codeMust use Microsoft Visual Studio .NET. This is useful in creating web based applications, and what gets
constructed in the forms automatically appears in code form in the source files. Much code is automated and helps with writing the asp .net tags.
JSP and Servlets, WSAD
JSP (Java Server Pages) is just like ASP, but it only supports Java in the scriptlets and the separate source files called Servlets (same general idea as ASP .NET). It also has its own tag libraries.
WebSphere Studio Application Developer, developed by IBM, is a tool specifically designed for producing web applications, but it is much more of a challenge to learn and use compared to MS Visual Studio .NET.
Successful Deployment of Web Application Demo
http://albatross.cslab.vt.edu/vtdiet/
WSAD made web application
UserName: FrancisDemoPassword: chessmaster