FIX: Editing ASP Pages Using FrontPage 98 Causes Problems

ID: Q190939


The information in this article applies to:


SYMPTOMS

An Active Server Pages (ASP) page created in Visual InterDev and edited in FrontPage 98 successfully appears the first time it is previewed, but displays errors if the page round trips to the server and back or you link to another page through server-side code.


CAUSE

The Scripting Object Model in Visual InterDev requires some specific text at the top of the page and just after the end </BODY> tag. This text includes a <FORM> tag. FrontPage does not allow <FORM> tags outside of the <BODY> tags. When you save a Visual InterDev ASP page that has the Scripting Model enabled (required for correct functionality of the Design- Time Controls) in FrontPage 98, the <FORM> tags will be moved to immediately follow the initial <BODY> tag. This means that none of the Design-Time Controls (DTC) within the <BODY> tags will be within the <FORM> tags, so any Post to the server will not recognize them


RESOLUTION

To preserve the round trip and server-side processing of code related to the DTCs, do not use FrontPage 98 to edit ASP pages that are dependent on the Scripting Object Model.

If you have already edited a page in FrontPage 98, use the following steps to restore the functionality:

  1. Open the page in Visual InterDev 6.0.


  2. In the properties for the page, select "Enable scripting object model."


  3. Gray read-only text will appear at the top of the page, and just after the </BODY> tag.


  4. Delete the following lines from the top of the page if duplicated:


  5. 
          <% ' VI 6.0 Scripting Object Model Enabled %>
          <!--#include file="_ScriptLibrary/pm.asp"-->
          <% if StartPageProcessing() Then Response.End() %> 
  6. Delete the <FORM> tags just following the <BODY> tag:


  7. 
          <form name="thisForm" METHOD="post">
          </form> 
  8. Delete the following lines from just after the <BODY> tag if duplicated:



  9. 
          <% ' VI 6.0 Scripting Object Model Enabled %>
          <% EndPageProcessing() %> 


STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

This bug was corrected in Visual Studio 6.0 Service Pack 3. For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:

Q194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

Q194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed


MORE INFORMATION

FrontPage 98 may also move script blocks or controls that were placed above the <BODY> tag to below the <BODY> tag. The script is generally maintained in whole blocks and therefore does not usually cause a problem.

The scripting object model uses hidden elements on the client to pass information back to the server. These elements are created on the fly through the call to EndPageProcessing(). This call must appear before the </FORM> tag, or the hidden elements are not part of the HTML form and have no effect.

Steps to Reproduce Behavior

  1. Create an ASP page in Visual InterDev 6.0.


  2. Add a button DTC.


  3. Click Yes to enable the scripting object model when prompted.


  4. Add a label DTC and set the caption.


  5. Write a server-side event handler for the button to alter the label caption, for example:


  6. 
          Sub Button1_onclick()
             Label1.setCaption(Label1.getCaption() & "*")
          End Sub 
  7. Save and browse the page.

    NOTE: You can click the button several times and a star is added each time.


  8. Open the file in FrontPage 98 and save it.


  9. Browse the page.

    NOTE: The button function works the first time you click and fails after that.


Additional query words:


Keywords          : kbservicepack kbExtension kbFrontPage kbServer kbVisID600bug kbGrpASP kbVS600sp2 kbVS600SP1 kbVS600sp3fix kbFrontPageX 
Version           : WINDOWS:6.0
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: July 9, 1999