Solved

How to stop Frontpage from changing code

Posted on 2003-11-05
8
470 Views
Last Modified: 2013-12-24
I have a lot of asp pages and prefer in most cases for the sake of convenience to work on them inside Frontpage 2000.
Sometimes I'll get my code just like I want it, hit the Save button and Frontpage thinks it knows more about how I want my
page to look than I do and screws the code up.  Is there an option in Front page that I can check/uncheck to tell Frontpage to
leave my code alone?
0
Comment
Question by:Mach1pro
  • 4
  • 2
  • 2
8 Comments
 
LVL 31

Expert Comment

by:seanpowell
ID: 9686495
Go to Tools > Page Options. Click on the HTML Source tab, and select the "Preserve existing HTML" radio button.

This is still hit and miss though - as it may attempt to correct what "it considers" to be malformed code. It will depend on the situation...
0
 
LVL 6

Author Comment

by:Mach1pro
ID: 9686566
I've got that checked.  Any other suggestions?
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9686633
I assume you're not using the "Normal View" to look at the pages...

There may be ways to get around it - but it depends on how your asp is being coded. Can you provide an example here of your code that FP modifies upon save?

Thanks
0
 
LVL 29

Expert Comment

by:coreybryant
ID: 9687011
FP 2000 is not a great program at all for programming ASP.  A lot of the ASP boards do not recommend it for this reason.  And as George pointed out - it is still hit & miss for the changing.  Usually missing.  You can edit it in another program & then upload it though.  That is the best way.  I used Ultraedit when I had FP 2K.  FP XP is better for editing ASP.

-Corey
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 6

Author Comment

by:Mach1pro
ID: 9687039
Here is one example.  I could probably change this to  response.write "<body ........."
The problem is that there are occassionally other instances where I've coded the page and then uploaded it and couldn't
find out why it didn't display until noticing that the code had been changed.  I just think that there should be some way to limit the amount of automation.

-------------------------------------
<html><head>
<script language='javascript'>
<!--
      function NotSignedIn(){
            location = "http://www.peerlessroadchurch.com"
            }
            //-->
</script>
</head>
<% If Not IsSignedIn(Session("UserID")) Then %>
      <BODY marginwidth="0" leftmargin="0" topmargin="0" marginheight="0">
      <center>
      <br><H3> We're Sorry</h3>
      <b>The page you are looking for requires you to Sign In first<br>
      <a href="http://www.homepage.com/signin.asp">Click Here</a> to Sign in or <br>
      You will automatically be redirected to our <a href="http://www.homepage.com">
      Home Page </a>in 5 seconds.</b></center>
      <script language="javascript">
      <!--
            setTimeout("NotSignedIn()",7000);
      //-->
      </script>
      </body>
      <% response.end
End If %>
<body>

<!-- html code here -->

</body>
</html>
0
 
LVL 31

Accepted Solution

by:
seanpowell earned 100 total points
ID: 9687180
Yup - that's a classic example all right.

Because FP has to setup an internal data scheme of the page in order to display it, it parses through the code and removes common errors.

As it doesn't render the asp code in between <% and  %>, it sees this:

<html><head>
<script language='javascript'>
<!--
     function NotSignedIn(){
          location = "http://www.peerlessroadchurch.com"
          }
          //-->
</script>
</head>
     <BODY marginwidth="0" leftmargin="0" topmargin="0" marginheight="0">
     <center>
     <br><H3> We're Sorry</h3>
     <b>The page you are looking for requires you to Sign In first<br>
     <a href="http://www.homepage.com/signin.asp">Click Here</a> to Sign in or <br>
     You will automatically be redirected to our <a href="http://www.homepage.com">
     Home Page </a>in 5 seconds.</b></center>
     <script language="javascript">
     <!--
          setTimeout("NotSignedIn()",7000);
     //-->
     </script>
     </body>
<body>

<!-- html code here -->

</body>
</html>

As far as it's concerned,  you've got duplicate body tags - and it tries to remove them.

The HTML, HEAD, BODY, and TITLE tags are only allowed to be used once in an HTML page. Consider:

<% if error=1 %>
  <body bgcolor="red">
<%else%>
  <body bgcolor="blue">
<%end if%>
</body>

or

 <% if error=1 %>
    sBgColor="red"
else
    sBgColor="blue"
end if
%>
<body bgcolor= "<%response.write sBgColor%>">
</body>

The first example will be altered, and the second will not, because there's only 1 body tag.

The question is, is your coding bad? Some people would argue that html content should not be trreated that way so as to remove the problem. Others argue that the WYSIWYG software shouldn't bother with it.

Personally I prefer to try and code as per the second example above, because I prefer the logic. In your example, I would use an include file that redirects the user to a "not logged in" page, however - this isn't about your code, it's about FP2000. And a reasonable answer from me is certainly not going to be "Change your code", because that's ridiculous, likely infeasible, and not of much help. So you're left with a couple of options:

1. Save your asp pages in Notepad, as opposed to FP. (Chances are you're not using Normal Mode anyway, so it shouldn't be too problematic.
2. Upgrade to a newer version of PF (XP)

How's that for frustrating...
0
 
LVL 29

Assisted Solution

by:coreybryant
coreybryant earned 50 total points
ID: 9687204
Yes - I have a few pages with two body tags & using FP XP.   It does not change the code..  

-Corey
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9687357
Time to grab the wallet again :-(
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how to gather data from news site 6 33
google maps v3 custom icon 9 133
How to change the text color in quantity field in woocommerce plugin 2 209
What xml editor to use. 8 84
This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now