Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 486
  • Last Modified:

How to stop Frontpage from changing code

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
Mach1pro
Asked:
Mach1pro
  • 4
  • 2
  • 2
2 Solutions
 
seanpowellCommented:
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
 
Mach1proAuthor Commented:
I've got that checked.  Any other suggestions?
0
 
seanpowellCommented:
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
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
coreybryantCommented:
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
 
Mach1proAuthor Commented:
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
 
seanpowellCommented:
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
 
coreybryantCommented:
Yes - I have a few pages with two body tags & using FP XP.   It does not change the code..  

-Corey
0
 
seanpowellCommented:
Time to grab the wallet again :-(
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

  • 4
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now