Creating Dynamic Creating Dynamic Content on the Web Content on the Web with IIS and ASP with IIS and ASP By Fred Rodriguez By Fred Rodriguez Texas Cooperative Extension Texas Cooperative Extension
Creating Dynamic Creating Dynamic Content on the Web Content on the Web
with IIS and ASPwith IIS and ASP
Creating Dynamic Creating Dynamic Content on the Web Content on the Web
with IIS and ASPwith IIS and ASPBy Fred RodriguezBy Fred Rodriguez
Texas Cooperative ExtensionTexas Cooperative Extension
Terminology• IIS
– Internet Information Server
• ASP– Active Server Pages
Microsoft’s Definition
Active Server Pages is an open, compile-free application environment in which you can combine HTML, scripts, and reusable ActiveX server components to create dynamic and powerful Web-based business solutions. Active Server Pages enables server-side scripting for IIS with native support for both VBScript and Jscript.
Static Content .vs. Dynamic Content
• Static Content– Does NOT change from unless author
updates the file
• Dynamic Content– Is generated “on the fly” when the
page is called into existence
Advantages of Dynamic Content
• Can more easily be kept current• Can adapt to user preferences• Can be maintained more easily• Information can be presented in
more than one form
Disadvantages of Dynamic Content
• More complex• Not easily searched• Slower
A different System for every purpose
• Application Development System• Content Management System• Information Management System• Web Development System• Document Management System
What do they have in common?
• Information– Acquisition– Storage– Management– Presentation– Organization
Important Functions/Subsystems
• Simple• Powerful• Web-based
– All Functions (Acquisition, Management, Storage, etc)
• Dynamic Generation of Content
Important Functions/Subsystems
• Database Back End– Single copy of Information – Content/Format separate
• Production and Development Environments– Separate Completely– Easy Migration – Both Environment fully functional
Competing Systems• Php • Perl• Cold Fusion• Dreamweaver• Front Page
Why IIS and ASP?
Fairly Popular Web Server (30%)
Fairly Cost Effective• $81
– Windows Server 2003 – Standard Edition– Texas State Contract– Educational Pricing– Enterprise Edition $323.90
Support• Available (but expensive)• User Groups• News Groups• Web Site (MSDN)• Internet Resources
Active Server Pages• Easy to write• Easy to read• Easy to debug• Easy to acquire
– Web resources– Experts are out there
Scripting Languages• Visual Basic Script • Java Script• C#
Servers for ASP?• Windows Server 2003• Windows 2000 (Server or Client)• Windows XP • Windows NT (Server or Workstation)• Windows 9x• Apache (with Apache::ASP extension)• Solaris (with Sun One ASP)
How do I use ASP?• Create a HTML-like file and save it with
a .asp suffix (file type)• Upload to a server• Browse the file• Did it Work?
– Yes, Great– No, note the error, fix, re-upload, try again
What does ASP Look Like?
• Start file with language definition– <%@ LANGUAGE = VBScript %>
• Code HTML Normally– <HTML>
• <HEAD>– <TITLE>This is my first ASP File</Title>
• </HEAD>
What Does ASP Look Like?
• Want to execute some code– <% (to start code segment)
• Response.Write “Hello World”
– %> (to return to HTML segment)
• Want value of variable in HTML segment?– <%= myvariable %>
A Simple ASP ExampleExample 1
• <%@ LANGUAGE = VBScript %>• <%• For I = 1 to 100• Response.Write “Hello World<BR>”• Next• %>
Another Simple Example
Example 2• <%@ LANGUAGE = VBScript %>• <TABLE BORDER=10><%• For I = 1 to 10• %><TR><%• For J = 1 to 5• %><TD BGCOLOR=RED><FONT
COLOR=YELLOW>Hello World</FONT></TD><%• Next• %></TR><%• Next• %></TABLE><%%>
Another Simple Example
Example 3• <%@ LANGUAGE = VBScript %>• <%• Response.Write "<TABLE BORDER=10>"• For I = 1 to 10• Response.Write "<TR>"• For J = 1 to 5• Response.Write "<TD BGCOLOR=RED><FONT
COLOR=YELLOW>Hello World</FONT></TD>"• Next• Response.Write "</TR>"• Next• Response.Write "</TABLE>"• %>
More Examples
Conclusion• IIS and Active Server Pages
– Easy to code– Inexpensive– Available– Powerful– Dynamic