Active Server Components In Asp.Net

What is active server components

– The Active Server components are technically OLE automation servers. They run as an out-of-process COM object on the servers. Since they are COM objects, they can be interfaced using the scripting languages. The Active Server components can live anywhere in the network.

What is Active Server Page in Visual Basic?

Active Server Pages (ASP) is a component of Microsoft’s Web server software that allows you to embed server-side script code in Web pages. As you know, the Hypertext Markup Language (HTML), used to created pages on the World Wide Web, is by itself static content.

Where are active server pages used?

Active Server Pages or ASP and Hypertext-Pre-Processor are the two standards for web application development. ASP is created and widely distributed to large businesses and corporations. ASP applications are often used primarily on windows-based servers and not on UNIX.

What does active server pages look like?

An Active Server Page (ASP) is an HTML page that includes one or more scripts (small embedded programs) that are processed on a Microsoft Web server before the page is sent to the user. … You name the HTML file with the “.

HOW TO: Create and Configure Active Server Pages (ASP) Web Applications in Windows 2000

How to Create an ASP Web Application

  1. Click Start, point to Programs, point to Administrative Tools, and then click Internet Services Manager.
  2. Click to expand * server name, where server name is the name of the server.
  3. Right-click the directory that you want to use as the application starting point, and then click Properties.

    NOTE: You can use the home directory of a Web site as the application starting point.
  4. In the directory nameProperties dialog box (where directory nameis the name of the directory that you selected), do one of the following:
    • If you selected a Web site, click the Home Directory tab.

      -or-
    • If you selected a virtual directory, click the Virtual Directory tab.

      -or-
    • If you selected a physical directory, click the Directory tab.
  5. Under Application Settings, click Create.

    NOTE: If the Create button is not present, a default application has already been specified. In this case, click Remove to remove the default application, and then click Create.
  6. In the Application name box, type the name of the application that you want. Note that the application starting point is displayed next to Starting point.
  7. In the Execute Permissions list, click the level of permissions that you want to give this application. For example, for ASP scripts or Internet Database Connector (IDC) scripts, click Scripts only.

    NOTE: The Scripts only option is more secure than the
    Scripts and Executables option.
  8. In the Application Protection list, click High (Isolated), and then click Apply.
  9. Click the Documents tab.
  10. If your application uses a default document that is not displayed in the document list, click Add.
  11. Type the name of the document in the Default Document Name box, and then click OK.
  12. Select the newly added document, and then click the up arrow button until the new document is at the top of the document list.

How to Configure an ASP Web Application

Certain properties can be set for each ASP application that you have created. To configure an ASP application, follow these steps:

  1. Click Start, point to Programs, point to Administrative Tools, and then click Internet Services Manager.
  2. In the Internet Information Services window, click to expand * server name, where server name is the name of the server.
  3. Right-click the Web site or the starting-point directory of the application that you want, and then click Properties.
  4. Depending on the starting-point directory that you selected, click the Home Directory, Virtual Directory, or Directory tab.
  5. Under Application Settings, click Configuration, and then click the App Options tab.
  6. Click to select the Enable session statecheck box if you want ASP to create a session for each user who access an ASP application.
  7. Click to select the Enable buffering check box if you want ASP to collect all output that is generated by the ASP page before the output is sent to the requesting Web browser.
  8. Click to select the Enable parent pathscheck box if you want ASP to use relative paths to the parent directory of the current directory (paths using the .. syntax).

    NOTE: If you enable this option, do not enable Execute permissions in the parent directories. This is to prevent a script in a subdirectory from running an unauthorized program in a parent directory.
  9. In the Default ASP language box, type the language that you want to use. This box specifies the language that is used to process commands within the ASP delimiters (<% and %>). Note that VBScript is the default ASP language.

    NOTE: You can override the default language in your ASP page by using the <%@LANGUAGE%> directive.
  10. In the ASP Script timeout box, type the length of time that want the ASP to allow a script to run.

    NOTE: You can set the timout period to a value between 1 and 2147483647.
  11. Click OK twice to save your changes and return to the Internet Information Services window.
  12. Quit IIS.

Example of How to Create an ASP Application in a New Web Site

The following example illustrates how to create an ASP application in a new Web site in IIS.

NOTE: This example assumes the default installation of Windows 2000 on the drive C.

Step 1: Create a Content Directory

  1. Start Windows Explorer, and then navigate to the following location:C:\Inetpub
  2. On the File menu, point to New, and then click Folder.
  3. In the New Folder box, type Content, and then press ENTER.
  4. Quit Windows Explorer.

Step 2: Create an ASP Application

  1. Start Windows Notepad.
  2. In the Notepad window, type the following code:<HTML>
    <HEAD><TITLE>ASP Application</TITLE></HEAD>
    <BODY BGCOLOR=white>
    <H1>ASP Application</H1>
    <HR>
    Type your name
    <FORM METHOD=POST ACTION=Output.asp>
    <INPUT TYPE=TEXT NAME="username">
    <INPUT TYPE=SUBMIT>
    </FORM>
    </BODY>
    </HTML>

  3. On the File menu, click Save As.
  4. In the Save As dialog box, navigate to Content in the Save in list, click All Files in the Save as type list, type
    Input.htm in the File name list, and then click Save.
  5. On the Edit menu, click Select All, and then click Delete on the Edit menu.
  6. In the Notepad window, type the following code:<HTML>
    <HEAD><TITLE>ASP Application</TITLE></HEAD>
    <BODY BGCOLOR=white>
    <P>You typed:

    <%
    NAME=REQUEST.FORM("username")
    RESPONSE.WRITE(NAME)
    %>
    </P>
    </BODY>
    </HTML>
  7. On the File menu, click Save As.
  8. In the Save As dialog box, click Content in the Save in list, click All Files in the Save as type list, type
    Output.asp in the File name list, and then click Save.

    The ASP Content folder contains the Input.htm file and the Output.asp file.
  9. Quit Notepad.

Step 3: Create a Web site

  1. Click Start, point to Programs, point to Administrative Tools, and then click Internet Services Manager.
  2. In the Internet Information Services window, click to expand * server name, where server name is the name of the server.
  3. Right-click Default Web Site, and then click Stop.
  4. Right-click * server name, point to New, and then click Web Site.
  5. After the Web Site Creation Wizard starts, click Next.
  6. On the Web Site Description page, type Example in the Description box, and then click Next.
  7. On the IP Address and Port Settings page, click Next.
  8. On the Web Site Home Directory page, type
    c:\inetpub\content in the Path box, and then click Next.
  9. On the Web Site Access Permissions page, verify that only the following check boxes are selected:Read
    Run scripts (such as ASP)
  10. Click Next, and then click Finish.

    The Example Web site is created and you are returned to the Internet Services Manager window.

Step 4: Configure the ASP Application

  1. In the Internet Services Manager window, right-click Example, and then click Properties.
  2. Click the Home Directory tab.
  3. Under Application Settings, click Create.

    NOTE: If the Create button is not present, a default application has already been specified. In this case, click Remove to remove the default application, and then click Create.
  4. Clear the contents of the Application namebox, and then type, Example.
  5. Click the Documents tab, and then click Add.
  6. In the Default Document Name box, type Input.htm, and then click OK.
  7. In the document list, click Input.htm, and then click the up arrow button until Input.htm is at the top of the list.
  8. Click OK. You are returned to the Internet Information Services window.

Step 5: Test the ASP Application

  1. Right-click Example, and then click Browse.
  2. The ASP Application page is displayed in the Web browser window.
  3. In the Type your name box, type your name, and then click Submit Query. A page similar to the following is displayed in the browser window, where name is the name that you typed:You typed: name

To remove the Example Web site and restart the Default Web Site, follow these steps:

  • Remove Example Web site:
    1. In the Internet Information Services window, right-click Example, click Delete, and then click Yes when the following message is displayed:Are you sure you want to delete this item?
      NOTE: This procedure does not remove the Content directory or the files that it contains.
  • Restart Default Web Site:
    Right-click Default Web Site, and then click Start. The Default Web Site is restarted.

Benefits of ASP

Benefits of ASP


ASP was designed as a faster and easier alternative to CGI scripting using Perl or C. It provides an easy-to-learn scripting interface (including native support for VBScript and JScript), along with a number of predefined objects that simplify many development tasks, such as maintaining user state and defining global variables within an application. ADO components can be used to perform additional functions, including accessing ODBC-compliant databases, and outputting data to text files. Java components and XML can be used to extend ASP scripts.

Additional benefits include the following:

  • ASP runs as a service of the Web server, and is optimized for multiple threads and multiple users. This means that ASP is fast and easy to implement.
  • ASP enables you to separate the design of your Web page from the details of programming access to databases and applications, allowing programmers and Web designers to focus exclusively on what they do best.
  • Server-side ASP scripts can be used to store HTML form information in a database, personalize Web sites according to visitor preferences, or use different HTML features based on the browser. Because scripts can run on the server rather than on the client, the Web server can do much of the work involved in generating the HTML pages sent to browsers. Server-side scripts cannot be readily copied because only the result of the script is returned to the browser; users cannot view the script commands that created the page they are viewing.
  • For the HTML author, ASP is an easy way to begin creating Web applications. To process user input on the Web server with CGI applications, a programming language such as Perl or C must be learned. With ASP, however, you can collect HTML form information and pass it to a database by using simple server-side scripts written in VBScript of JScript that are embedded directly in your HTML documents.
  • ASP is language-neutral, so if you’re skilled at a scripting language such as VBScript or JScript, you already know how to use ASP.
  • If you develop Web applications by using a programming language such as Java, Visual Basic, or C++, you will appreciate the flexibility of ASP. In addition to using scripts to create an engaging HTML interface for your application, you can also use Java components to encapsulate your application’s business logic into reusable modules that can be called from a script, from another component, or from another program.
0Shares

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *