Solved

How to stop Frontpage from changing code

Posted on 2003-11-05
8
476 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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
 
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

When deciding to adopt any help desk solutions many factors should be explored before taking decisions. This will change from business to another but in general there are some kind of rule of thumb. Here are some quick tips: Do we need only ticket…
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.
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…

696 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