RaysWebClass.Com |
Active Server Pages (ASP) is a programming scheme developed by Microsoft for Web developers to use behind their web pages for verification, manipulation, database access and email access. ASP makes it possible to create web applications that are every bit as sophisticated as any desktop application. With knowledge of HTML, CSS and ASP there is no limit to the type of web sites you can create. In fact, a lot of the most sophisticated web sites out on the web were developed using ASP. ASP's native language is VBScript (a simple form of Visual BASIC), but ASP can be written in JavaScript as well. For beginners VBScript in much easier to learn so we will be using VBScript. In truth, most ASP programmers use VBScript, its easy to read and write and every bit as powerful as JavaScript.
Note: This course is designed to be taught in 12, three hours sessions. Short Courses will cover the following topics: Includes, ASP structure, Database Access/Edit/Delete, Search Engines and Logins.
ASP source code looks like this: <% Response.Write 99 * 77 %> Browser source code looks like this: 7623
<!-- * * * * * * * * * * * * * * * -->
<!-- * Save as myTestProgram.asp * -->
<!-- * * * * * * * * * * * * * * * -->
<html>
<head>
<title> My Test Program </title>
</head>
<body>
<h1>Hello World</h1>
<img src='images/HelloWorld.gif'><br>
Snippet of advanced code from a team of graduate students in robotics at Cal Tech. </body>
</html>
<!-- * * * * * * * * * * * -->Replace myTestProgram.asp with the name of any ASP web page you're currently testing. (It's GREAT!!!)
<!-- * Save as ~Run.html * -->
<!-- * * * * * * * * * * * -->
<html>
<head>
<meta http-equiv='refresh' content='0;url=http://localhost/myTestProgram.asp '>
</head>
<body>
</body>
</html>
<div style='text-align: center;Here is my Menu file: (Includes / Menu.asp)
font: bold 30pt Verdana; color: blue; width: 100%;
filter: shadow(color=gray, direction=135)'>
Ray's web Company
</div>
<%Here is my Footer file: (Includes / Footer.asp)
Dim FName
FName = Request.ServerVariables("PATH_INFO")
%>
<br><br>
<div style='padding-left: 8px; font: 9pt arial;'>
<a href='index.asp'>
<%If Instr(FName,"index.asp") > 0 Then Response.Write "<b style='color: red;'>"%>
home
<%If Instr(FName,"index.asp") > 0 Then Response.Write "</b>"%>
</a>
<br><br>
<a href='Products.asp'>
<%If Instr(FName,"products.asp") > 0 Then Response.Write "<b style='color: red;'>"%>
products
<%If Instr(FName,"products.asp") > 0 Then Response.Write "</b>"%>
</a>
<br><br>
<a href='Contact.asp'>
<%If Instr(FName,"contact.asp") > 0 Then Response.Write "<b style='color: red;'>"%>
contact us
<%If Instr(FName,"contact.asp") > 0 Then Response.Write "</b>"%>
</a>
<br><br>
</div>
<div style='font:9pt arial;width:100%;text-align:center'>And here is my Page Table Template that I've used to create all of my pages on this Web site:
[
<a href='index.asp'>home</a>
|
<a href='Products.asp'>products</a>
|
<a href='Contact.asp'>contact</a>
]
<br>
© <%=Year(Date)%> Ray's Web Company
</div>
<html>Any edits to the Menu.asp file will update every web page with the SSI because the content is only in menu.asp. Also notice that a Header.asp and a Footer.asp files are also includes. NOTE: If the include file is not in the same folder (or a child folder) use the second include form; see above.
<head>
<title>Page Table Template</title>
</head>
<body bgcolor='gray' style='margin:0;border:0;padding:0;'>
<table border='1' bgcolor='white' align='center' width='800' height='100%'>
<!-- * Header * -->
<tr>
<td colspan='2' height='100'>
<!-- * Header goes below here * -->
<!--#include file='Includes/Header.asp'-->
<!-- * Header goes above here * -->
</td>
</tr>
<!-- * Menu * -->
<tr>
<td width='120' valign='top'>
<!-- * Menu goes below here * -->
<!--#include file='Includes/Menu.asp'-->
<!-- * Menu goes above here * -->
</td>
<!-- * Main Body * -->
<td valign='top'>
<!-- * * * * * * * * * * * * * * * -->
<!-- * Main Body goes BELOW here * -->
<!-- * * * * * * * * * * * * * * * -->
<!-- * * * * * * * * * * * * * * * -->
<!-- * Main Body goes ABOVE here * -->
<!-- * * * * * * * * * * * * * * * -->
</td>
</tr>
<!-- * Footer * -->
<tr>
<td colspan='2' height='60'>
<!-- * Footer goes below here * -->
<!--#include file='Includes/Footer.asp'-->
<!-- * Footer goes above here * -->
</td>
</tr>
</body>
</html>
<!DOCTYPE html>Save it.
<html lang='en'>
<head>
<meta charset='utf-8'>
</head>
<body bgcolor='lightblue'>
<h1>Page One</h1>
Welcome to page one!
<br><br><br><br><br>
<br><br><br><br><br>
<br><br><br><br><br>
<hr>
<!--#include file='menu.asp'-->
</body>
</html>
<div align='center'>Save it.
[
<a href='Page1.asp'>Page One</a>
|
<a href='Page2.asp'>Page Two</a>
|
<a href='Page3.asp'>Page Three</a>
|
<a href='Page4.asp'>Page Four</a>
|
<a href='Page5.asp'>Page Five</a>
]
</div>