aspx and FP2K again

  • Thread starter Thread starter Dennis Blondell
  • Start date Start date
D

Dennis Blondell

Hi, Another problem I seem to be having with aspx and FP2K is include pages.
I am using the include page webbot for htm pages which works fine and allows
a better wysiwyg design view. I use <!-- #Include
virtual="IncludePage.htm" --> for the aspx pages. However when the source is
viewed on the published pages, the aspx pages are including the <html> and
<body> tags, so makes the page very messy. If I remove the <body> etc tags
in the include pages the webbots don't seem to work. Do I have to use <!--
#Include virtual="IncludePage.htm" --> for all the pages?, remove the <body>
and <html> tags in the include pages and do away with webbots altogether? or
is there another way? I want to maintain only one set of pages that I am
including.

Cheers, btw you guys are very helpful :-)
 
Hi Dennis,

Those two includes function differently. The include in FP2 is a save time
component in that it draws in HTML from between the body tags at the time
the page is saved. It is a webbot component.

The <!--#include is an Server Side Include (SSI) meaning that it reads in
the entire file and includes it in the output stream of the page.

One work around is to only use the webbot component in both the .htm, asp,
and aspx pages.
 
-----Original Message-----
Hi, Another problem I seem to be having with aspx and
FP2K is include pages. I am using the include page webbot
for htm pages which works fine and allows a better
wysiwyg design view. I use <!-- #Include
virtual="IncludePage.htm" --> for the aspx pages. However
when the source is viewed on the published pages, the
aspx pages are including the <html> and <body> tags, so
makes the page very messy. If I remove the <body> etc
tags in the include pages the webbots don't seem to work.
Do I have to use
<!-- #Include virtual="IncludePage.htm" --> for all the
pages?, remove the <body> and <html> tags in the include
pages and do away with webbots altogether? or is there
another way? I want to maintain only one set of pages
that I am including.

As you've probably discovered, the Include Page component
doesn't work properly on .aspx pages. The include shows up
OK in FrontPage, but only the <!--webbot--> tag appears
in the saved version.

Using an <!-- #Include virtual="IncludePage.htm" --> in
both "flat" and .aspx page should work, with two provisos:

o The included "page" must not contain <html>, <head>, or
<body> tags. It can only contain body-type content.
This will preclude editing the content in the FrontPage
WYSIWYG editor, (which adds <html>, <head>, and <body>
if they're "missing").
o You'll need to name your flat pages with filename
extensions of .asp or .stm, or modify your Web server
configuration to invoke SSI processing for .htm pages.

FWIW, in my own work, I don't use either Include Page
components or SSI includes in .aspx pages. Instead, I use
Web User Controls (.ascx files), which have the advantage
of being programmable. Even these, however, have some
quirks:

o They only work in .aspx pages. As a result, I end up
renaming a lot of pages from .htm to .aspx just so
they can display the user control.
o .ascx files are difficult to create in FrontPage.
As a result, I use Visual Studio for that job.
(VB.NET Standard, which costs about the same as
FrontPage, works just as well.)
o FrontPage doesn't automatically fix links in .ascx
files. Therefore, for example, I make each <img> tag
a server control, and add code to correct the path
in its src property. So for this HTML:

<img src="../images/whatever.jpg"
runat="server" id="imgMyPic" />

I would add this code to Page_Load():

imgMyPic.Src = Request.ApplicationPath & _
"/images/" & _
Path.GetFileName(imgMyPic.Src)

BTW, you'll probably encounter a variety of problems using
FP2000 to work with .aspx pages. Snap up a copy of FP2003
as soon as you can find it, and in the meantime find a way
to run FP2002.

Jim Buyens
Microsoft FrontPage MVP
(e-mail address removed)
http://www.interlacken.com
Author of:
*------------------------------------------------------*
|\----------------------------------------------------/|
|| Microsoft Office FrontPage 2003 Inside Out ||
|| Microsoft FrontPage Version 2002 Inside Out ||
|| Web Database Development Step by Step .NET Edition ||
|| Troubleshooting Microsoft FrontPage 2002 ||
|| Faster Smarter Beginning Programming ||
|| (All from Microsoft Press) ||
|/----------------------------------------------------\|
*------------------------------------------------------*
 
Thanks for that Mike but I have been through using webbots and aspx before.
Due to aspx and its differences from html, I cannot use a FP2K webbot on an
aspx page. It just wont display when published. I am hoping that FP2003 will
resolve this issue or maybe I am putting too much hope in Microsoft :-) I
may just have to use SSI for all pages.

My aspx guy uses WebMatrix and DreamWeaver and we often have debates about
who's app is screwing up pages. I will hold off for FP2003 before I fall
down on my sword :-)
 
when perusing some asp.net applications a while back I noticed lots of runat
server stuff. there seemed to be a huge demand on the server (like your map
path for the image example).
Is this type of activity easy enough on a server that it wouldn't affect the
performance of the server? I'm asking this in the context of what most of
us work/ publish to, a shared hosting environment.
TIA
 
-----Original Message-----
when perusing some asp.net applications a while back I
noticed lots of runat server stuff. there seemed to be
a huge demand on the server (like your map path for the
image example). Is this type of activity easy enough on
a server that it wouldn't affect the performance of the
server? I'm asking this in the context of what most of
us work/ publish to, a shared hosting environment.

I use a host that specializes in ASP.NET Web sites, and
they don't seem to use any special hardware or charge any
extra. My site runs with others on a 1.6MHz CPU and
performance is snappy.

Don't forget that ASP.NET pages, unlike ASP, compile to
native code. There's a one-time hit during the first
access to a page, because the server has to compile the
source code twice: once to .NET Intermediate Language
Code, and then to native code. But then the native code
gets cached until the page goes unused for a long time,
or you update the page, or someone restarts IIS.

ASP.NET has a lot of caching capability, too. For
example, if you have a page that doesn't change very
often, you can tell ASP.NET to cache the output for 5,
10, 60, or whatever minutes. If additional visitors ask
for the same page within the cache limit, .NET skips
running the page and redelivers the previous output. You
can even tell .NET to cache different versions of the
page for each combination of query string or POST
variables.

Anyway, most Web servers have very low CPU utilization.
Reading files from disk and shoveling them out the
network port just aren't CPU-intensive activities. So,
you might as well burn some of that unused resource.

Jim Buyens
Microsoft FrontPage MVP
(e-mail address removed)
http://www.interlacken.com
Author of:
*------------------------------------------------------*
|\----------------------------------------------------/|
|| Microsoft Office FrontPage 2003 Inside Out ||
|| Microsoft FrontPage Version 2002 Inside Out ||
|| Web Database Development Step by Step .NET Edition ||
|| Troubleshooting Microsoft FrontPage 2002 ||
|| Faster Smarter Beginning Programming ||
|| (All from Microsoft Press) ||
|/----------------------------------------------------\|
*------------------------------------------------------*
 
Using an <!-- #Include virtual="IncludePage.htm" --> in
both "flat" and .aspx page should work, with two provisos:

o The included "page" must not contain <html>, <head>, or
<body> tags. It can only contain body-type content.
This will preclude editing the content in the FrontPage
WYSIWYG editor, (which adds <html>, <head>, and <body>
if they're "missing").
o You'll need to name your flat pages with filename
extensions of .asp or .stm, or modify your Web server
configuration to invoke SSI processing for .htm pages.

I think this looks like the only way I can really get around the problem and
still use FP. Will FP not try and modify .asp and .stm pages buy adding tags
when editing? I don't think my hosting service would allow me to change
their web server configeration.
FWIW, in my own work, I don't use either Include Page
components or SSI includes in .aspx pages. Instead, I use
Web User Controls (.ascx files), which have the advantage
of being programmable. Even these, however, have some
quirks:

o They only work in .aspx pages. As a result, I end up
renaming a lot of pages from .htm to .aspx just so
they can display the user control.

I may have to look at using .ascx files as I have had trouble with search
forms etc in the include pages and presume .ascx files would allow the
"Sub btnSearch_Click(sender As Object, e As EventArgs)
Response.Redirect("a_searchresults.aspx?txtSearch=" & txtSearch.Text)
End Sub"
to be coded only in the .ascx file. The only problem with renaming the pages
from .htm to aspx is I have heard that some search engines dont like ranking
aspx pages.
o .ascx files are difficult to create in FrontPage.
As a result, I use Visual Studio for that job.
(VB.NET Standard, which costs about the same as
FrontPage, works just as well.)

I presume you are talking about FP2003? I am tempted to get Visual Studio
but feel like it might be a little beyond me with my limited programming
knowledge and I thought that it would be a lot harder to use than FP. I
though that FP2003 might be more beneficial.
o FrontPage doesn't automatically fix links in .ascx
files. Therefore, for example, I make each <img> tag
a server control, and add code to correct the path
in its src property. So for this HTML:

<img src="../images/whatever.jpg"
runat="server" id="imgMyPic" />

I would add this code to Page_Load():

imgMyPic.Src = Request.ApplicationPath & _
"/images/" & _
Path.GetFileName(imgMyPic.Src)

Sounds like this would take a lot of extra coding in pages and loose the
wysiwyg approach.
BTW, you'll probably encounter a variety of problems using
FP2000 to work with .aspx pages. Snap up a copy of FP2003
as soon as you can find it, and in the meantime find a way
to run FP2002.

Your sure right there! I really hope that FP2003 will offer a better way to
create web site incorporating .net and I suppose I need to learn a lot more
about how it works also. Roll on Oct 21st. I was told to start to learn asp
before asp.net as with asp there are only 7 object models to work with(?). I
may just have to pick up some texts to read.

Cheers
 
May I ask you what host you are using that specializes in asp.net? I am
still hunting around for hosts. I am thinking of going with
http://www.gainwithus.com. They seem to have a really good reseller plan and
have asp.net

Thanks
 
Hi Jim,

I'll have to disagree with this statement as I've used the FP include
component in ASPX pages and had no experiences like you're describing. See
http://www.websunlimited.com/new_page_4.aspx as an example -- it has a
calendar control along with our standard Top banner which is an include
page.

I'm wondering how you have your Optimization settings set?
 
ASP.Net has its own "include" functionality, which isn't anything like SSI
or FrontPage Include WebBots, due to the fact that ASP.Net is
object-oriented. A Server-side include is basically procedural in nature.
When working with ASP.Net, it is better to use Web User Controls for content
that is shared among pages. Web User Controls also give you complete
programmatic control over the content in the included portion.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.
 
I understand. Thanks for the solid answer! I guess MS wouldn't have
developed something so grandiose and have a "consumption" issue right from
the start, or at least one that I'd see. ;-)

thanks,
chris
 
Well that's interesting, your page sure does seem to have a webbot include
in it. I am looking forward to any responses. I am using FP2K with my
includes that don't work.
 
Dennis Blondell said:
May I ask you what host you are using that specializes in asp.net? I am
still hunting around for hosts. I am thinking of going with
http://www.gainwithus.com. They seem to have a really good reseller plan and
have asp.net

I'm using http://www.alentus.com/. Service and support has been good,
but you'll need to make other arrangements for credit card processing.
If it makes a difference to you, they're located in Edmonton, Canada.

As to http://www.gainwithus.com, I have no experience.

http://www.actionjackson.com is good place to look for a host.

Jim Buyens
Microsoft FrontPage MVP
(e-mail address removed)
http://www.interlacken.com
Author of:
*------------------------------------------------------*
|\----------------------------------------------------/|
|| Microsoft Office FrontPage 2003 Inside Out ||
|| Microsoft FrontPage Version 2002 Inside Out ||
|| Web Database Development Step by Step .NET Edition ||
|| Troubleshooting Microsoft FrontPage 2002 ||
|| Faster Smarter Beginning Programming ||
|| (All from Microsoft Press) ||
|/----------------------------------------------------\|
*------------------------------------------------------*
 
Back
Top