Introduction to ASP

Source: Internet
Author: User
Tags object execution html tags iis object model version variable web services
Read the "How to make your site" dynamic full "of a text, whether to make you exciting? Are you impatient to build your own dynamic Web site? This article will be centered around active Server pages to show you the steps and techniques to make a dynamic business site and, through a large number of examples, make you proud of your "network" in constant theory and practice ...

The last chapter gives you a brief introduction to the establishment of dynamic Web site, some of the methods and tools, this chapter will be based on the IIS ASP Dynamic Web site as the center to everyone step-by-step to reveal the real mystery of the design of dynamic commercial websites. In order to enable you to fully and carefully grasp the development of ASP skills, this article will take the form of serialization, hands-on teaching you how to build your own ASP Dynamic Web site. Because this article is the author according to own study and the practical experience and unifies some foreign language material to write, therefore unavoidably may have some biased, hoped that everybody forgive me. If you find any improper in this article, please notify the author in time, thank you.
Microsoft Active Server Pages, what we call ASP, is actually a set of Microsoft-developed server-side scripting environments, which are embedded in IIS 3.0 and 4.0, with ASP we can combine HTML pages, ASP directives, and Ac Tivex components to create dynamic, interactive, and efficient WEB server applications. With ASP you don't have to worry about whether the client's browser will be able to run the code you write, because all programs will be executed on the server side, including all the scripting programs embedded in normal HTML. When the program is finished, the server only returns the results of the execution to the client browser, which reduces the burden on the client browser and greatly increases the speed of the interaction.
Here's a list of some of the features unique to Active Server Pages:

1. Using simple scripting languages such as VBScript, Jscript, and HTML code, you can quickly complete your Web site's applications.

2. No compile compile, easy to write, can be directly implemented on the server side.

3. Use a normal text editor, such as a notepad for Windows, for editing and design.

4. Browser-Independent (Browser independence), the client can browse the content of Web pages that are designed by Active Server pages as long as they use an executable HTML code browser. The scripting language (VBScript, Jscript) used in Active Server Pages is in the WEB
Server-Side execution, the client's browser does not need to be able to execute these scripting languages.

5.Active Server Pages can be compatible with any ActiveX scripting language. In addition to being designed using VBScript or Jscript languages, other scripting languages provided by third parties, such as REXX, Perl, TCL, are used in plug-in. The scripting engine is a COM (Component object Model) object that handles a script program.

6.Active Server Pages of the source program, will not be uploaded to the client browser, so you can avoid the written source program by others plagiarism, but also improve the security of the program.

7. Server-side scripts can be used to generate client script.

8. Object Oriented (object-oriented).

9.ActiveX Server components (ActiveX server component) has unlimited scalability. You can use the programming languages of Visual Basic, Java, Visual C + +, COBOL to write the ActiveX Server Component you need.


The wonders of the ASP are countless, below please fasten your seatbelt, I will lead you into the dream world of ASP.


First, let's look at the environments that are required to run ASP:


    • Microsoft Internet Information Server version 3.0/4.0 on Windows NT server
    • Microsoft Peer Web Services Version 3.0 on Windows NT Workstation
    • Microsoft Personal Web Server on Windows 95/98

As mentioned above, unlike general procedures,. ASP programs do not need to compile, the control of the ASP program is used in VBScript, Jscript and other scripting languages to design, when the implementation of ASP program, the script will send a complete set of commands to the script interpreter (that is, script engine)
, which is translated by the script interpreter and converted to a command that the server can execute. Of course, as with other programming languages, ASP program writing also follow certain rules, if you want to use your favorite scripting language to write ASP program, then your server must have the ability to interpret this scripting language script interpreter. When you install ASP, the system provides two scripting languages: Vbsrcipt and Jscript, while Vbscript is the default scripting language for the system. You can also change the default scripting language of your system according to your preferences, see the scripting language in ASP.


The ASP itself is not a scripting language, it simply provides an environment in which scripting programs embedded in HTML pages can run. However, to learn the ASP and must master its grammar and rules. Now let's start with a step-by-step understanding and learning about active Server Pages.

The ASP program actually exists on the Web server in plain text format with the extension. asp, you can open it with any text editor, and the ASP program can contain plain text, HTML tags, and script commands. You simply place the. asp program in the Web server's virtual directory (the directory must have executable permissions), you can access the ASP program via www. To learn the design of ASP program, must master the script writing, then what is the script? In fact, the script is composed of a series of script commands, like a normal program, the script can assign a value to a variable, you can command the Web server to send a value to the client browser, you can also define a series of commands as a process. To write a script, you have to be familiar with at least one scripting language, such as VBScript. A scripting language is a special language between HTML and programming languages such as JAVA, Visual Basic, and C + +, and although it is closer to the latter, it does not have complex, rigorous syntax and rules for programming languages. The scripting environments provided by ASP, as described earlier, can support multiple scripting languages, such as Jscript, REXX, PERL, and so on, which undoubtedly provide an extensive scope for ASP programmers. The advent of ASP has made it unnecessary for the vast majority of web designers to worry about whether or not to support customer browsers in fact, even if you're using a different scripting language in the same. asp file, you don't have to worry about it because everything is going to be done on the server side, and the client browser gets just the result of a program execution, And you just have to declare in. asp that you can use a different scripting language. The following is a typical example of using two scripting languages in the same. asp file:

< html>

< body>

< table>

<% call Callme%>

</table>

<% call Viewdate%>

</body>


< SCRIPT Language=vbscript runat=server>

Sub Callme

Response.Write "< tr>< td>call</td>< td>me</td></tr>"

End Sub

</script>


< SCRIPT Language=jscript runat=server>

function Viewdate ()

{

var x

x = new Date ()

Response.Write (X.tostring ())

}

</script>


This is your first contact in this article of the real ASP program, do not be "<%%>" symbol confused, this is actually the standard ASP delimiter, and "< script></script>" between the scripting language. Unlike the scripting language, ASP has its own specific syntax, and all ASP commands must be contained within <% and%>, such as <% test= "中文版"%>, ASP through the expressions included in <% and%> Line results are exported to the customer browser, such as: <% =test%> is the value of the previous assignment to the variable test sent in English

[1] [2] Next page



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.