FP97: How to Edit, Manage Active Server Pages with FrontPage (161779)



The information in this article applies to:

  • Microsoft FrontPage 97 for Windows with Bonus Pack

This article was previously published under Q161779

SUMMARY

Microsoft Internet Information Server (IIS) Active Server Pages (ASP) pose unique challenges to authors using FrontPage 97. This article discusses some important considerations about using FrontPage 97 to manage or edit Active Server Pages.

NOTE: Earlier versions of the FrontPage Server Extensions do not support IIS ASP syntax. To use Active Server Pages, install the FrontPage 97 Server Extensions for the Microsoft Internet Information Server.

MORE INFORMATION

FrontPage 97 allows you to create and manage Active Server Pages. In general, when you create Active Server Pages in FrontPage Editor, be aware of the following considerations:
  1. FrontPage 97 cannot manage links which originate in a Meta tag. It is customary to create links to Active Server Pages by using the http-equiv "REFRESH" attribute of the Meta tag. However, links that originate in a Meta tag do not appear as links in the FrontPage Explorer and they are not updated when you rename or move the files that link to or from these links.
  2. Save the file using the .asp file name extension. IIS 3.0 requires the .asp file name extension in order to process Active Server Pages.
  3. Save the file in an executable directory. Files that are stored in a non-executable directory do not execute. For example, when you view the page in a web browser, the page is not interpreted and rendered correctly by the web browser and the code is displayed instead of its result.

    NOTE: You cannot browse an executable directory. If you mark a directory that contains HTML pages as executable, users will not see your content.
  4. FrontPage Editor treats ASP syntax as a text-level object and requires that it be embedded within one of the following HTML elements:

    paragraph (<p>)
    table row (<tr>) and table cell (<td>)
    list (<li>)

    On the other hand, if the ASP is the value of a tag attribute, then the ASP does not need to be embedded within an HTML element. (See item 6 below.)

    If the ASP code is not embedded inside an HTML tag or as a tag attribute, the FrontPage Editor automatically inserts the opening and closing tags around the ASP code. In this case, FrontPage also automatically removes these tags when you save the page or when you click the HTML command on the View menu. Although this process does not adversely affect most HTML, FrontPage 97 may rearrange the syntax of your ASP code in such a way that it ceases to function properly. In this case, you may need to embed the affected code inside an HTML element, such as a paragraph, table, or list element using the View Or Edit HTML dialog box. (To access this dialog box, click HTML on the View menu.)
  5. Active server pages can contain scripted links, as in this example:

    <a href="/<%OBJnextlink.GetNextUrl("/www/nextlink.txt")%></a>

    FrontPage Explorer reports these links as broken; however, the links function if you post your content on a properly configured IIS 3.0 server.
  6. FrontPage Editor maintains an internal list of HTML tags which allow extended attributes. If you attempt to insert ASP code inside a tag that does not allow extended attributes, the ASP code is discarded by the FrontPage Editor. For additional information, click the article number below to view the article in the Microsoft Knowledge Base:

    161420 FP97: FrontPage Editor Deletes Unknown Attributes in HTML

  1. Server-side includes do not expand in the FrontPage Editor. They are parsed into an HTML markup section. They still function if posted on a properly configured IIS 3.0 server. The following is an example of a server side include:

    <!--#include virtual="/test.inc"-->

    NOTE: An HTML markup section is created from the View Or Edit HTML dialog box.
  2. Multiple line link structures may be stripped out. Active Server Pages can process multi-line scripts to evaluate the correct URL to render in a web browser. FrontPage 97 does not parse an HREF attribute on an Anchor tag if the HREF contains either a carriage return or a line feed character. To preserve this code, type the code in the View Or Edit HTML dialog box.
  3. Any method or function which needs to be at the very top of the file must be invoked in VBScript bacause FrontPage will move all other file data after the <!DOCTYPE> tag. If routines using these methods are called within VBscript syntax (<% %>) then they will not be moved below the DOCTYPE line by FrontPage.

ADDITIONAL INFORMATION

To create Active Server Pages in FrontPage 97 Editor, use the following steps:
  1. On the Insert menu, click Script.
  2. Under Language, select VBScript, and then click to select Run Script On Server.
  3. In the Script box, type the ASP code.
  4. Click OK.

    FrontPage will automatically surround your code with the "<%" and "%>" characters to enable execution on an IIS 3.0 server.

    NOTE: You can also type the server code in the View Or Edit HTML dialog box, but you must manually add the <% and %> characters to enable execution on an IIS 3.0 server.

    FrontPage inserts the Visual Basic Script icon in your document to indicate that a Visual Basic script has been added to your page. You can view or edit the script by double-clicking the icon.

    You may also add scripts to the attributes of HTML tags if the tags support extended attributes. Any tag which supports extended attributes will include an Extended button in its Properties dialog box. In this case, a Visual Basic Script icon is not displayed in the FrontPage Editor.

Modification Type:MajorLast Reviewed:2/20/2002
Keywords:kbhowto kbusage KB161779