260 likes | 278 Views
Web Based Applications. A ctive S erver P ages. Introduction. Moving away from stand-alone model Focus on web-based distributed model Web-based applications provide platform independence. Overview. About ASP Technology ASP Object Model ASP Application Demo. About ASP Technology.
E N D
Web Based Applications Active Server Pages
Introduction • Moving away from stand-alone model • Focus on web-based distributed model • Web-based applications provide platform independence
Overview • About ASP Technology • ASP Object Model • ASP Application Demo
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 • Script 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 • Includes methods to manipulate user data
Methods CreateObject Execute Transfer 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 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
Summary • ASP helps create web-based applications • ASP brings dynamic content to the web • ASP provides platform independent environment for distributed programming
Useful Online Resources • Microsoft MSDN Library http://msdn.microsoft.com • W3Schools Online Web Tutorials http://www.w3schools.com