270 likes | 280 Views
Learn about Active Server Pages (ASP) technology, its object model, and creating ASP applications for dynamic, web-based data processing. Dive into ASP files, scripts, sessions, requests, responses, and error handling. Utilize ASP objects for server resources and user input. Explore the ASP Global.asa file and building ASP applications via Microsoft IIS console. Access useful online resources for further learning.
E N D
Web Based Applications Active Server Pages
Introduction • Moving away from stand-alone model • Focus on web-based data processing • Need for anytime, anywhere access
Overview • About ASP Technology • ASP Object Model • Creating ASP applications
What Is ASP? • ASP is a Microsoft Technology • ASP stands for Active Server Pages • ASP is a program that runs inside IIS
What Is An ASP File? • ASP file is similar to an HTML file • ASP file extension has to be “.asp” • It can contain HTML, XML, and scripts
What Is An ASP Script? • ASP scripts use VBScript or JScript syntax • ASP code is included within <% %> tags • Scripts execute on the server before sending output to the client browser
What Can ASP Do? • Provide dynamic content to any web page • Respond to user queries from HTML forms • Access any data or database for content • Customize websites for each individual • Minimize network traffic with fewer pages
ASP Application Object • Used to store objects and variables for the application that can be accessed by every ASP page • Contents store the information about the application’s state and behavior
Methods Lock UnLock Events Application_OnStart Application_OnEnd ASP Application Object • Usage • Application(“VariableName”) = Variable • Variable = Application(“VariableName”) • Set Object = Application(“ObjectName”)
ASP Session Object • Used to store information for a single user • Session information is stored in a cookie • Common session information can include user’s id, name, and preferences
Methods Abandon Events Session_OnStart Session_OnEnd ASP Session Object • Usage • Session(“VariableName”) = Variable • Variable = Session(“VariableName”) • Set Object = Session(“ObjectName”)
ASP Server Object • Used to access information about the server • Provides methods to access server resources • Enables server management at run-time
Methods CreateObject Execute Transfer MapPath GetLastError HTMLEncode URLEncode ASP Server Object
ASP Request Object • Used to access information from users • Provides methods for processing user input • User input comes from forms, cookies, URLs, web browsers, and client certificates
Collections Form Cookies QueryString ServerVariables Methods BinaryRead Properties TotalBytes ASP Request Object
ASP Response Object • Used to send server output to the users • Provides methods to send HTTP headers, HTML content or even files to the users • Output can be directed to the web browser or to a cookie on user’s machine
Collections Cookies Methods BinaryWrite Write Redirect Properties Buffer Expires ContentType IsClientConnected Status ASP Response Object
ASP Error Object • Used to display detailed information of any error in scripts in an ASP page • Provides easy alternative to line-by-line debugging
Properties ASPCode ASPDescription Category Description File Line Column Source ASP Error Object
Other ASP Objects • ASP File System Object Provides access to server’s file system • ASP ADODB Object Provides access to database sources • ASP Dictionary Object Collection structure similar to C++ Map
ASP Global.asa File • Used to declare objects, variables, and methods that can be accessed by every single page in an ASP program • Includes event handlers for Application and Session start and end
Learning Plan • Using Microsoft IIS Console • Creating websites in IIS • Basic ASP application demo • Login script dissection
Summary • ASP enables web-based processing • ASP Object Model is flexible • ASP is a proven technology
Useful Online Resources • Microsoft MSDN Library http://msdn.microsoft.com • W3Schools Online Web Tutorials http://www.w3schools.com