Poor support for ASP and Scripting

F

Floored

There's something REALLY ANNOYING in FP2003.
Take the following snippet of code from an APS file for example:
<% If 1=1 Then %>
<body onload="window.print()" >
<% Else %>
<body onload="window.close()" >
<% End If %>

Save that in FP2003, and it decides it would rather change both those body
tags to have window.close(). It kind of defeats the whole purpose of that bit
of script doesn't it?
So what's the solution? Open the file in notepad, change your code, and
never ever save it in FP again.
I guess if Microsoft themselves don't use FP to author their sites, it's a
pretty good advertisement for not using FP.

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/com...575&dg=microsoft.public.frontpage.programming
 
P

p c

Set FP to preserve "existing" HTML. I am using FP2k so the names may be
diferent:
FP-->Tools-->page Options-->HTML source-->check off Preserve existing HTML

...PC
 
S

Stefan B Rusynko

No
- just inappropriate ASP coding since there are 2 body tags for FP to contend w/
If should be coded as

<body <%If 1=1 Then%>onload="window.print()"<%Else%>onload="window.close()"<%End If%>>

PS
Neither event will work in Win XP SP 2 unless the window is opened by JavaScript and a user click event
--

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


| There's something REALLY ANNOYING in FP2003.
| Take the following snippet of code from an APS file for example:
| <% If 1=1 Then %>
| <body onload="window.print()" >
| <% Else %>
| <body onload="window.close()" >
| <% End If %>
|
| Save that in FP2003, and it decides it would rather change both those body
| tags to have window.close(). It kind of defeats the whole purpose of that bit
| of script doesn't it?
| So what's the solution? Open the file in notepad, change your code, and
| never ever save it in FP again.
| I guess if Microsoft themselves don't use FP to author their sites, it's a
| pretty good advertisement for not using FP.
|
| ----------------
| This post is a suggestion for Microsoft, and Microsoft responds to the
| suggestions with the most votes. To vote for this suggestion, click the "I
| Agree" button in the message pane. If you do not see the button, follow this
| link to open the suggestion in the Microsoft Web-based Newsreader and then
| click "I Agree" in the message pane.
|
|
http://www.microsoft.com/office/com...575&dg=microsoft.public.frontpage.programming
 
K

Kevin Spencer

<%
Dim onload
If 1=1 Then
onload = "window.print()"
Else
onload = "window.close()"
End If
%>
<body onload="<%=onload%>" >

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.
 
F

Floored

The code I put in was merely an example. Certainly, if this was the only time
that such a code existed, then your alternate code would work fine. My basic
point was that if I write code, it should stay that way, or, at worst, flag
an error/alert me when saving. It should NOT alter my file when i hit save,
without telling me.
 
F

Floored

It would appear that FP2003 decided to omit this rather useful feature. Or at
least hide it somewhere I cannot find, and offer no relevant results in a
help search for "preserve existing html"
 
T

Thomas A. Rowe

However if FP writes the code, you can not stop FP from changing/rewriting the code when you save
the page. If you need to modify the code generated by FP and not have FP change/re-write it, you
would have to rename or remove the webbot tags.

All versions of FP work in this manner.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================

Floored said:
The code I put in was merely an example. Certainly, if this was the only time
that such a code existed, then your alternate code would work fine. My basic
point was that if I write code, it should stay that way, or, at worst, flag
an error/alert me when saving. It should NOT alter my file when i hit save,
without telling me.

Stefan B Rusynko said:
No
- just inappropriate ASP coding since there are 2 body tags for FP to contend w/
If should be coded as

<body <%If 1=1 Then%>onload="window.print()"<%Else%>onload="window.close()"<%End If%>>

PS
Neither event will work in Win XP SP 2 unless the window is opened by JavaScript and a user click
event
--

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


| There's something REALLY ANNOYING in FP2003.
| Take the following snippet of code from an APS file for example:
| <% If 1=1 Then %>
| <body onload="window.print()" >
| <% Else %>
| <body onload="window.close()" >
| <% End If %>
|
| Save that in FP2003, and it decides it would rather change both those body
| tags to have window.close(). It kind of defeats the whole purpose of that bit
| of script doesn't it?
| So what's the solution? Open the file in notepad, change your code, and
| never ever save it in FP again.
| I guess if Microsoft themselves don't use FP to author their sites, it's a
| pretty good advertisement for not using FP.
|
| ----------------
| This post is a suggestion for Microsoft, and Microsoft responds to the
| suggestions with the most votes. To vote for this suggestion, click the "I
| Agree" button in the message pane. If you do not see the button, follow this
| link to open the suggestion in the Microsoft Web-based Newsreader and then
| click "I Agree" in the message pane.
|
|
http://www.microsoft.com/office/com...575&dg=microsoft.public.frontpage.programming
 
T

Thomas A. Rowe

preserve existing html is the built-in default for FP2003. You can not stop FP from change any
webbot code when saving a page.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
F

Floored

Essentially all FP is to me is a colorful version of notepad.
I don't get FP to write anything.
And I don't know why the whole webbot idea got introduced to this thread
 
B

Bob

Can you show us an example of a page that has the code the way "you" want
and then the same page as FrontPage has made changes??

BTW: If you think that everyone here works for Microsoft you are wrong.
Some have earned the title of MVP but they don't work for Microsoft.

bob
| Essentially all FP is to me is a colorful version of notepad.
| I don't get FP to write anything.
| And I don't know why the whole webbot idea got introduced to this thread
|
| "Thomas A. Rowe" wrote:
|
| > However if FP writes the code, you can not stop FP from
changing/rewriting the code when you save
| > the page. If you need to modify the code generated by FP and not have FP
change/re-write it, you
| > would have to rename or remove the webbot tags.
| >
| > All versions of FP work in this manner.
| >
| > --
| > ==============================================
| > Thomas A. Rowe (Microsoft MVP - FrontPage)
| > ==============================================
| > If you feel your current issue is a results of installing
| > a Service Pack or security update, please contact
| > Microsoft Product Support Services:
| > http://support.microsoft.com
| > If the problem can be shown to have been caused by a
| > security update, then there is usually no charge for the call.
| > ==============================================
|
 
T

Thomas A. Rowe

Because you are using the FP Include Page Component, which is a webbot!

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
F

Floored

perhaps I misread what I typed, but I couldn't see
<!-- #include
in any of the previous posts. ???? Now I'm really confused
 
F

Floored

the changing of the onLoad value was an example. I'll post again
<% If 1=1 Then %>
<body onload="window.print()" >
<% Else %>
<body onload="window.close()" >
<% End If %>

This gets converted to:
<% If 1=1 Then %>
<body onload="window.close()" >
<% Else %>
<body onload="window.close()" >
<% End If %>

Also, I did know that MVP <> Microsoft employee - sorry if it seemed to come
across that this was the case.
 
T

Thomas A. Rowe

So am I at this point, it appears that this thread has gotten confused with another thread...

See Kevin's reply on how best to solve your issue.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
B

Bob

The next question is ...
What are you try to accomplish with this code?

IF 1=1 (and it does)
Then print the page? (right)
ELSE (what else 1=1 always right)

all you need to invoke the printer dialog is the onload event.
<body onload="window.print()" >

Or am I missing something here?
I am as confused as the rest....

bob
| the changing of the onLoad value was an example. I'll post again
| <% If 1=1 Then %>
| <body onload="window.print()" >
| <% Else %>
| <body onload="window.close()" >
| <% End If %>
|
| This gets converted to:
| <% If 1=1 Then %>
| <body onload="window.close()" >
| <% Else %>
| <body onload="window.close()" >
| <% End If %>
|
| Also, I did know that MVP <> Microsoft employee - sorry if it seemed to
come
| across that this was the case.
|
|
| "Bob" wrote:
|
| > Can you show us an example of a page that has the code the way "you"
want
| > and then the same page as FrontPage has made changes??
| >
| > BTW: If you think that everyone here works for Microsoft you are wrong.
| > Some have earned the title of MVP but they don't work for Microsoft.
| >
| > bob
| > | > | Essentially all FP is to me is a colorful version of notepad.
| > | I don't get FP to write anything.
| > | And I don't know why the whole webbot idea got introduced to this
thread
| > |
| > | "Thomas A. Rowe" wrote:
| > |
| > | > However if FP writes the code, you can not stop FP from
| > changing/rewriting the code when you save
| > | > the page. If you need to modify the code generated by FP and not
have FP
| > change/re-write it, you
| > | > would have to rename or remove the webbot tags.
| > | >
| > | > All versions of FP work in this manner.
| > | >
| > | > --
| > | > ==============================================
| > | > Thomas A. Rowe (Microsoft MVP - FrontPage)
| > | > ==============================================
| > | > If you feel your current issue is a results of installing
| > | > a Service Pack or security update, please contact
| > | > Microsoft Product Support Services:
| > | > http://support.microsoft.com
| > | > If the problem can be shown to have been caused by a
| > | > security update, then there is usually no charge for the call.
| > | > ==============================================
| > |
| >
| >
| >
 
K

Kevin Spencer

The problem here is that FrontPage parses HTML that is entered in the
Editor, and attempts to interpret it for a variety of reasons, not the least
of which is displaying it in WYSIWYG fashion. FrontPage cannot read the ASP
code to figure out what it is doing; it simply ignores it, and interprets
the HTML that is left over. If you build your ASP tags correctly as I
illustrated, FrontPage will not mess with the code. This is because it is
correct HTML, even without the ASP code. This also represents a better
approach to ASP programming in general, as it treats the client-side object
like a single Control that has variable properties, rather than a tangled
mesh 2 Controls, of server-side ASP and client-side HTML. If code is
well-organized, it is easier to debug, maintain and extend. Just assign
variable values to attributes, and so on. Process the variable values in
code, as separate as possible from the HTML markup itself.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top