Solved

How to stop Frontpage from changing code

Posted on 2003-11-05
8
469 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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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.
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

707 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

13 Experts available now in Live!

Get 1:1 Help Now