FIX: Extra Line Feeds Added When Moving File Between Folders

ID: Q166677


The information in this article applies to:
  • Microsoft Visual InterDev, version 1.0


SYMPTOMS

Sometimes when a file containing at least one relative URL is moved into a folder that changes the reference to the linked file, an extra line feed is added to all scripts (whether contained within <SCRIPT>...</SCRIPT> tags or within <%...%> delimiters) and comment blocks (enclosed with <!--...-->).


CAUSE

When Link Repair is turned on, FrontPage Extensions look for relative URLs in the file. If found, they modify the URL as necessary to ensure that the linked files remain valid when called from the new directory. FrontPage Extensions may also attempt to insert missing HTML in the file. When this routine runs, it adds an extra line feed when it encounters server-side scripts.


RESOLUTION

Turn off Link Repair or use absolute references to linked files.


STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been fixed in Visual InterDev 6.0.


MORE INFORMATION

Steps to Reproduce Behavior

  1. Be sure Link Repair is enabled for the project (refer to the Properties page for the Project).


  2. Be sure your Project has at least one subdirectory, for example, /images.


  3. Create an .asp file with the following contents (you don't need a real .jpg file, just a relative reference): <% Response.Write "test" Response.Write "test2" %> <img src="images/test.jpg">


  4. Copy this example to your Clipboard for reuse below.


  5. Release Working Copy for this .asp file and save to the root directory when prompted.


  6. Move the file into the images directory.


  7. Open the file. You are prompted with a message box that says, "Lines ending with only a carriage return have been detected. These will be modified to include a line feed."


  8. The file looks something like this: <% Response.Write "test" Response.Write "test2" %><html> <body> <p><img src="../images/test.jpg"> </p> </body> </html> Visual InterDev has added syntax to make a legal HTML file. In the process it has added extra lines in the source ASP code and around the first two HTML tags.


  9. Release the Working Copy of this file, then move it back to the root directory. Open the file and replace its contents with the contents on your Clipboard. You should now be in your original state.


  10. Remove the IMG tag so there is no URL in your file or make the relative address absolute by placing a "/" before "images." Release the Working Copy and save as before.


  11. Move the file to the images directory again, and open it. This time nothing has changed because there is no relative URL in the file.



REFERENCES

For the latest Knowledge Base articles and other support information on Visual InterDev and Active Server Pages, see the following page on the Microsoft Technical Support site:

http://support.microsoft.com/support/vinterdev/

Additional query words:

Keywords : kbExtension kbFrontPage kbServer kbVisID100 kbVisID100bug kbVisID600fix kbGrpASP
Version : WINDOWS:1.0
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: November 8, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.