Recommended: Simple and familiar with ASP syntax and variables You cannot directly obtain the source code of ASP through the View-Source File option on the browser (because the ASP code and script program must be interpreted and executed on the server in advance; then, the server will then interpret the result after the ASP code is interpreted in HTML
A few years ago, the only channel in the industry for dynamic homepage release was the CGI (Common Ga teway Interface) model. Although the subsequent technical solutions such as ISAPI, NSAPI and JDBC have improved compared to CGI, they are still not suitable for rapid development, timely maintenance and large-scale technology popularization based on the technical reality of the enterprise network (Intranet). The emergence of ASP technology has made dynamic interactive web homepage design a relaxed and pleasant job. With just a few lines of script statements, the database information in the background can be published on the Internet/Intranet, which is much better than traditional technical solutions in terms of programming and readability of web scripts.
ASP is the abbreviation of Active Server Pages (Dynamic Server Home Page). It is a server-side scripting environment that interprets scripts on the site's web server and can generate and execute dynamic, interactive, and efficient site server applications. ASP can be competent for the release of various dynamic data based on Microsoft Web servers.
The difference between ASP method and traditional static homepage
After incorporating the information system into the Internet/Intranet framework, the first problem to be solved is to access the backend database information through web pages. All applications are divided into pages, and users' interactions are implemented by submitting forms, etc., which requires the Web site to have strong dynamic data publishing capabilities. However, currently, Web services are still mainly used to provide static homepage content. The so-called static means that the homepage content of the site is fixed and cannot be changed according to user needs and actual conditions. When the browser applies for a homepage to the site's web server through the Internet's HTTP protocol, the site server will transmit the designed static HTML file to the browser. To update the content of the homepage, you can only update the HTML file data in a non-online manual way.
ASP designed a dynamic homepage, which can receive information submitted by users and respond. The data in it can change according to actual conditions and can meet application needs without manually updating web page files. For example: When filling in a form on the browser and submitting an HTTP request, you can ask to execute an application set by the form on the site server, rather than just a simple HTML file. The application analyzes the input data of the form and transmits the corresponding execution results (usually the result set of database searches) to the browser in HTML format according to different data content. Data in the database can change at any time, but applications executed on the server do not need to be changed. The web page information obtained by the client will always remain fresh and charming.
How to work and configuration of ASP
As shown in the figure, when the user applies for a *.asp homepage, the web server responds to the HTTP request, calls the ASP engine, and explains the requested documents. When any scripts compatible with ActiveX Script (such as VBScript and JScript) are encountered, the ASP engine calls the corresponding script engine to process it. If the script instruction contains a request to access the database, it is connected to the background database through ODBC, and the database access component performs the database access operation. The ASP script is interpreted and executed on the server side. It automatically generates a home page that conforms to the HTML language based on the result set of the access database to respond to user requests. All relevant publishing work is the responsibility of the web server. Figure 1 Active Server Pages working principle diagram
It is necessary to pay attention to the specific operation details of the database access. When encountering a script command to access the database, ASP talks to the database through ActiveX component ADO (ActiveX Data Objects) (ADO is built on Microsoft's new database API, namely OLE DB. The current OLE DB interacts with the existing ODBC database through the ODBC engine. Further OLE DB versions will directly deal with the database and will no longer pass the ODBC engine), and dynamically generate an HTML page to return to the server side to respond to the browser's request. What you see in the user-side browser is a pure HTM L representation, such as the field content in the background database table represented by tables. Since ASP combines scripting language, it can access Active veX components programmatically and has the ability to automatically generate HTML on the spot, it has become an effective tool for building dynamic Web sites.
In terms of structural relationships, ASP deals with databases through ODBC. Therefore, it is compatible with various database systems to the upper layer. For the lower layer, the HTML generated by ASP has a wide adaptability to the client's browser. But ASP is picky about the web server itself, which seems like a flaw, but in fact it may be a business strategy - it only supports web servers under various operating systems of Microsoft, and their minimum version is:
·Windows NT Server 4.0: Microsoft ⅡS (Internet Informatio Server) 3.0;
·Windows NT Workstation 4.0: Microsoft Peer Web Services 3.0;
·Windows 95: Microsoft PWS (Personal Web Server) 1.0, Chinese Win95 should be equipped with Chinese PWS.
The installation of ASP is divided into two situations: Windows NT and Windows 95. For NT, IIS and ActiveX Server Pages are included in Service Pack 3; for Win95, the ActiveX Server Pages installation option under the Visual Studio Server component can be used. After the installation is successful, you will find an ActiveX Serr Pages Roadmap homepage in the Program Manager to guide you to learn and use ASP.
Features and functions of ASP
From the technical perspective of the software, ASP has the following characteristics:
1. There is no need to compile ASP scripts to be integrated into HTML, easy to generate, and can be directly interpreted and executed without compilation or linking.
2. Easy to generate and use a regular text editor (such as Notepad under WINDOWS) to design the *.asp page. If you consider work efficiency, you might as well choose Visual InterDev with visual editing capabilities.
3. Independently from the browser user side, you can browse the home page designed by ASP by using a browser that can interpret regular HTML code. ASP scripts are executed on the site server side, and the browser on the user side does not need to support it. Therefore, if you do not observe the *.asp homepage by downloading from the server, you will not see the correct page content on the browser side.
4. Object-oriented can easily reference system components and ASP built-in components in ASP scripts, and can also expand functions by customizing ActiveX Server Component (ActiveX Server Component).
5. Compatible with any ActiveX scripting language In addition to designing using VBScript and JScript languages, other scripting languages provided by third parties can also be used in Plug-in.
6. The source program code will not leak the ASP scripts to be executed on the server. The only thing that is transmitted to the user's browser is the regular HTML code generated by the ASP execution result. This ensures that the program codes written with great effort will not be stolen by others.
From the application perspective, ASP has the following functions:
1. Process the form input sent by the browser to the site server.
2. Access and edit server-side database tables. Use a browser to enter, update, and delete data from the site server's database.
3. Read and write files of the site server to realize functions such as visitor counters and mottos.
4. Provide built-in functions such as advertising carousel, obtaining browser information, and URL table management.
5. Read and write the hard disk files of the user side by cookies to record the user's data.
6. It can be realized to share information among multiple home pages to develop complex business site applications.
7. Use simple scripting languages such as VBScript or JScript, combined with HTML code to quickly complete the application of the site. Execute scripting language through the site server, generate or change the scripting language executed on the client.
8. It has strong ability to expand functions. You can use Visual Basic, Java, Visual C and other programming languages to create ActiveX Server Components to meet your special needs.
Share: ASP Programming--Newbie's Going to the Road: Introduction to ASP Technology ASP is the abbreviation of Microsoft Active Server Pages. ASP is a server-side scripting platform developed by Microsoft. ASP is included in IIS. Currently, the highest version of IIS is version 5.0. Through ASP, we can combine HTML web pages and ASP instructions