How to disable FrontPage 2003 autoformating of code?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I recently started using FrontPage 2003 SP2, which wants to insert <p> tags
such that it alters the intended layout of the web controls on the page I’m
creating. Attempts to disable autoformatting via "tools|page options|code
formatting" has been unsuccessful.
Can autoformatting be turned off? If so, how? Alternatively, is their a
fix for this problem?
 
Inserts <p> tags when and where?
- only when you hit the return key

Code formatting has nothing to do w/ it
--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


|I recently started using FrontPage 2003 SP2, which wants to insert <p> tags
| such that it alters the intended layout of the web controls on the page I’m
| creating. Attempts to disable autoformatting via "tools|page options|code
| formatting" has been unsuccessful.
| Can autoformatting be turned off? If so, how? Alternatively, is their a
| fix for this problem?
|
 
Stefan,

Thanks up front for your responding to my post. What follows may be a bit
long winded, if so, I apologize.

Actually in this case FP 2003 is inserting one <p> tab and removing two.
The code I’m using is the Panel Class example given in the Framework 2.0 SDK
Documentation. It can be found via .Net Framework SDK | Class Library |
System.Web.UI.WebControls | Panel Class. The example code programmatically
generates or hides (based on user input) from 0 to 4 Labels and/or TextBoxes.

When the code is copied and pasted into a Notepad file, stored in a web
folder, and opened with FP into a code window, I observe that the following:
1- The original code has 4 <p> tags and 1 <br> tags near the end of the text
file organized as follows:
<Form>
<asp:Panel ...>
text
<p>
</asp:Panel>
<p>
text
<asp:DropDownList ...>
...asp:ListItems...
</asp.DropDownList>
<br>
text
<asp:DropDownList ...>
...asp:ListItems...
</asp.DropDownList>
<p>
<asp:CheckBox .../>
<p>
<asp:Button .../>
</Form>
2- After loading into a FP code window, the above code displays as:
<Form>
<asp:Panel ...>
text
<p>
</asp:Panel>
<p>
Text 1
<asp:DropDownList ...>
...asp:ListItems...
</asp.DropDownList>
<p> <- INSERTED BY FP
<br>
Text 2
<asp:DropDownList ...>
...asp:ListItems...
</asp.DropDownList>
<p> <- REMOVED BY FP
<asp:CheckBox .../>
<p> <- REMOVED BY FP
<asp:Button .../>
</Form>
3- If the code is previewed (in IE 6) before it is saved in its altered form
(btw, no asterisk is appended to the end of the file name on the code view
tab even though it is altered), it appears that the unaltered version of the
code is still used. That is, Text 1 and its associated DropDownList, Text 2
and its associated DropDownList, the CheckBox, and Button are all displayed
on separate lines.
4- After the code is saved, the changes noted above take effect. That is,
Text 1 and its associated DropDownList appear on one line, the remaining Text
2, its associated DropDownList, the CheckBox, and Button all appear on one
line with extra blank lines between it and the line above.
5- I can’t find a FP control that turns off this type of formatting. It
works fine if FP doesn’t intervene, so I question the usefulness of the
autoformatting in this case.

Interestingly, Jim Buyens, in his book, Mircosoft Office FrontPage 2003
(page 65) makes the comment: “People who create code by hand – whether HTML
or some other language – are usually fastidious about it. Even if the browser
doesn’t care about capitalization, line endings, and indentation, human
beings do. As a result, FrontPage is very careful not to reformat or
oherwise (sic) change your code.†While Jim may not be referring to the
alteration webcontrols here, it seems to me this is as bad if not worse,
since I seem not to be able to override the changes being made by FP that
appear on the webpage.


Stefan B Rusynko said:
Inserts <p> tags when and where?
- only when you hit the return key

Code formatting has nothing to do w/ it
--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


|I recently started using FrontPage 2003 SP2, which wants to insert <p> tags
| such that it alters the intended layout of the web controls on the page I’m
| creating. Attempts to disable autoformatting via "tools|page options|code
| formatting" has been unsuccessful.
| Can autoformatting be turned off? If so, how? Alternatively, is their a
| fix for this problem?
|
 
FP is correcting malformed html (nested p tags w/o p tag terminators)
- after you paste in code view right click & select reformat html to see what it will do to correct your malformed html code on file
save

Try

<Form>
<asp:Panel ...>
<p>text1</p>
</asp:Panel>
<p>text2<asp:DropDownList ...></asp.DropDownList></p>
<p>text3<asp:DropDownList ...></asp.DropDownList></p>
<p><asp:CheckBox .../></p>
<p><asp:Button .../></p>
</Form>

If you don't want anything changed
(inspite of the code you have being malformed)
Wrap your code snippet with
<!--webbot bot="HTMLMarkup" startspan -->
<Form>
........
</Form>
<!--webbot bot="HTMLMarkup" endspan -->

Same as using Insert Web Component Advanced Html from Design view

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| Stefan,
|
| Thanks up front for your responding to my post. What follows may be a bit
| long winded, if so, I apologize.
|
| Actually in this case FP 2003 is inserting one <p> tab and removing two.
| The code I’m using is the Panel Class example given in the Framework 2.0 SDK
| Documentation. It can be found via .Net Framework SDK | Class Library |
| System.Web.UI.WebControls | Panel Class. The example code programmatically
| generates or hides (based on user input) from 0 to 4 Labels and/or TextBoxes.
|
| When the code is copied and pasted into a Notepad file, stored in a web
| folder, and opened with FP into a code window, I observe that the following:
| 1- The original code has 4 <p> tags and 1 <br> tags near the end of the text
| file organized as follows:
| <Form>
| <asp:Panel ...>
| text
| <p>
| </asp:Panel>
| <p>
| text
| <asp:DropDownList ...>
| ...asp:ListItems...
| </asp.DropDownList>
| <br>
| text
| <asp:DropDownList ...>
| ...asp:ListItems...
| </asp.DropDownList>
| <p>
| <asp:CheckBox .../>
| <p>
| <asp:Button .../>
| </Form>
| 2- After loading into a FP code window, the above code displays as:
| <Form>
| <asp:Panel ...>
| text
| <p>
| </asp:Panel>
| <p>
| Text 1
| <asp:DropDownList ...>
| ...asp:ListItems...
| </asp.DropDownList>
| <p> <- INSERTED BY FP
| <br>
| Text 2
| <asp:DropDownList ...>
| ...asp:ListItems...
| </asp.DropDownList>
| <p> <- REMOVED BY FP
| <asp:CheckBox .../>
| <p> <- REMOVED BY FP
| <asp:Button .../>
| </Form>
| 3- If the code is previewed (in IE 6) before it is saved in its altered form
| (btw, no asterisk is appended to the end of the file name on the code view
| tab even though it is altered), it appears that the unaltered version of the
| code is still used. That is, Text 1 and its associated DropDownList, Text 2
| and its associated DropDownList, the CheckBox, and Button are all displayed
| on separate lines.
| 4- After the code is saved, the changes noted above take effect. That is,
| Text 1 and its associated DropDownList appear on one line, the remaining Text
| 2, its associated DropDownList, the CheckBox, and Button all appear on one
| line with extra blank lines between it and the line above.
| 5- I can’t find a FP control that turns off this type of formatting. It
| works fine if FP doesn’t intervene, so I question the usefulness of the
| autoformatting in this case.
|
| Interestingly, Jim Buyens, in his book, Mircosoft Office FrontPage 2003
| (page 65) makes the comment: “People who create code by hand – whether HTML
| or some other language – are usually fastidious about it. Even if the browser
| doesn’t care about capitalization, line endings, and indentation, human
| beings do. As a result, FrontPage is very careful not to reformat or
| oherwise (sic) change your code.†While Jim may not be referring to the
| alteration webcontrols here, it seems to me this is as bad if not worse,
| since I seem not to be able to override the changes being made by FP that
| appear on the webpage.
|
|
| "Stefan B Rusynko" wrote:
|
| > Inserts <p> tags when and where?
| > - only when you hit the return key
| >
| > Code formatting has nothing to do w/ it
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > To find the best Newsgroup for FrontPage support see:
| > http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
| > _____________________________________________
| >
| >
| > |I recently started using FrontPage 2003 SP2, which wants to insert <p> tags
| > | such that it alters the intended layout of the web controls on the page I’m
| > | creating. Attempts to disable autoformatting via "tools|page options|code
| > | formatting" has been unsuccessful.
| > | Can autoformatting be turned off? If so, how? Alternatively, is their a
| > | fix for this problem?
| > |
| >
| >
| >
 
Stefan,
I corrected the malformed html so that it matched your suggested format,
that is:
<Form>
<asp:Panel ...>
<p>text1</p>
</asp:Panel>
<p>text2<asp:DropDownList ...></asp.DropDownList></p>
<p>text3<asp:DropDownList ...></asp.DropDownList></p>
<p><asp:CheckBox .../></p>
<p><asp:Button .../></p>
</Form>

FP altered it as follows:

<Form>
<asp:Panel ...>
<p>text1</p>
</asp:Panel>
<p>text2</p>
<asp:DropDownList ...></asp.DropDownList>
<p>text3</p>
<asp:DropDownList ...></asp.DropDownList>
<asp:CheckBox .../>
<asp:Button .../>
</Form>

Since the original html was not malformed, why would FP alter it? And in a
manner that changes the way it is displayed on the webpage?

Your alternative suggestion, that of wrapping the html in question within
the webbot statements worked fine! Unfortunately, I have been unsuccessful
finding any documentation on the webbot tag. Can you recommend a source?

Thank you again for your very informed help. My frustration level has
dropped significantly.
 
Back
Top