Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to stop Frontpage from changing code

Posted on 2003-11-05
8
Medium Priority
?
482 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

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

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.

Question has a verified solution.

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

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…
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 integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. 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 : Go t…

721 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