Getting REndered HTML into FrontPage Web Page

D

Doug Thews

I've got some dynamically rendered HTML that I want to insert into a
specific table cell in a FrontPage web page. The app that spits it out is
an ASP.NET web page, but I can build a web service to spit it out, a .NET
GAC assembly, or just a plain-old COM component. I guess I can also just
insert a DIV into the table and make a reference to the ASP.NET page, but
I'll probably lose all my formatting and it just doesn't feel as clean.

My question is: What is the best practice for getting this information into
an existing FrontPage web page? I'm hesitant to just rename the web page to
ASPX and then use VS.NET to edit it, because the majority of the page is
just UI, and it's a lot easier to edit THAT stuff with FrontPage.

Thanks in advance for the help.
 
J

Jim Buyens

Create an ASP.NET Web User Control that creates the
dynamically-rendered HTML, and then add the control to
an .aspx page.

If you set up the Visual Studio ASP.NET project and the
FrontPage Web site in the same location, you can pretty
much switch between the two programs at will. For more
info, consult:

Microsoft Office FrontPage 2003 Inside Out
Chapter 43
Using FrontPage 2003 and Visual Studio .NET Together

This is available on-line at:
http://msdn.microsoft.com/library/en-
us/odc_fp2003_bk/html/odc_fp_C43615101.asp

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

Doug Thews

The point is that I already have a web page and I want to insert a
dynamically generated HTML fragment into it. FrontPage does not recognize
ASP.NET user controls, so I can just insert one into the FrontPage web page.
I've read the article (excerpt from the FP 2003 book, actually), and that's
more if I wanted to create a mix of ASP.NET web pages and FrontPage web
pages.

Yes, I could just take the existing web page, rename it to ASPX, and then do
my stuff there. But I'd like to save that for a last resort. What I'm
looking for is a way to consume this dynamically generated HTML fragment.
Is there a way I can get it in there without having to rename my existing
web pages and treat them like they're ASP.NET pages?
 
T

Thomas A. Rowe

Unless you name the page with .aspx, the server will not know to process the ASP.net control within
the page, this is not a FP issue.

The same applies to any server-side function that requires the server to process the page in order
for the component/script to be displayed in the browser.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
D

Doug Thews

OK, thanks. Is there a reason that I can't use a .NET component (either
wrapped as a COM component or not) within a FrontPage web page? What about
all those objects that you're able to insert using FrontPage? How about
being able to use that as a mechanism?

I'm not insisting on a client-side solution. I prefer the server-side
solution, but I don't want to have to rename my master web page to ASPX,
when all I need is this dynamic HTML segment in one small table cell.
 
T

Thomas A. Rowe

Here is a solution, create a .aspx page with your component/control, etc., then insert a IFrame into
your .htm page and load the .aspx page into the IFrame.

Many of the FP components are design-time control which appear as plain HTML in the pages when
viewed in a browser, others are run-time components, such as forms, etc. are processed on the server
via the FP extensions. FP run-time components can not be implemented in pages processed on the
server with .asp, .aspx, .php, etc. nor can ASP, PHP script be processed in .htm(l) pages (unless
the host is willing to remap the .htm(l) to the appropriate DLL on the server).
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
D

Doug Thews

I can do it that way, but not all browsers render that IFRAME the same (I've
had that problem before with DIVs & IFRAMEs). Also, does the target of the
IFRAME inherit the display properties of the calling page? Will it be using
the same text, background and other properties that I've carefully
cultivated in my "master" page.

Lastly, what about my idea of using a .NET component (or .NET component
wrapped in a COM object) within a FrontPage web page?
 
T

Thomas A. Rowe

The page loaded in the IFrame is completely independent of the page hosting the IFrame.

Not possible, the FP extensions can not interact with server- side scripting engines. If you make it
a ActiveX component, then only IE users will see it, plus they will receive a security prompt.

What is wrong with just renaming this one page with .aspx extension?

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
D

Doug Thews

It's a page with some FP components already placed. It's kind of like a
portal summary with tidbits of latest information from a lot of different
sources. Once of which is my blog, where I want to show the last 10 blog
entries. So, I created a .NET component to generate a fragement of HTML
with the date of the post and the title as a hyperlink. I want to put this
in the table cell area I have reserved for recent blog entries. So, by
renaming it to ASPX, I eliminate the ability to work with it as I normally
would in FrontPage.

Anyway, I know that I can create a FP-add in (I guess) which is basically a
registered COM component (which can just be a COM wrapper around a .NET
assembly), but I was checking to see if anyone had information on how
difficult that was (are there any specific tricks), or if there was a better
way. The IFRAME way is quick & dirty - I was looking for a more elegant
solution.

--
Doug Thews
Director, Customer Solutions
D&D Consulting Services
----------------
Visit my Tech Blog at:
http://www.ddconsult.com/blogs/illuminati/



Thomas A. Rowe said:
The page loaded in the IFrame is completely independent of the page hosting the IFrame.

Not possible, the FP extensions can not interact with server- side
scripting engines. If you make it
 
T

Thomas A. Rowe

See inline below.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================


Doug Thews said:
It's a page with some FP components already placed. It's kind of like a
portal summary with tidbits of latest information from a lot of different
sources. Once of which is my blog, where I want to show the last 10 blog
entries. So, I created a .NET component to generate a fragement of HTML
with the date of the post and the title as a hyperlink. I want to put this
in the table cell area I have reserved for recent blog entries. So, by
renaming it to ASPX, I eliminate the ability to work with it as I normally
would in FrontPage.

You can set FP to edit .aspx pages under Tools| Options | Configure Editors
Anyway, I know that I can create a FP-add in (I guess) which is basically a
registered COM component (which can just be a COM wrapper around a .NET
assembly), but I was checking to see if anyone had information on how
difficult that was (are there any specific tricks), or if there was a better
way. The IFRAME way is quick & dirty - I was looking for a more elegant
solution.

Suggest you post this to the microsoft.public.frontpage.programming newsgroup.
 
J

Jim Buyens

Doug Thews said:
OK, thanks. Is there a reason that I can't use a .NET component (either
wrapped as a COM component or not) within a FrontPage web page?

Yes. The Web server will see the .htm file name extension, and assume
based on that that the server shouldn't look for ASP.NET user controls
or any other sort of server-side programming. The XML tags that define
the user control would go out unchanged to the Web visitor.

The same would be true if you used ASP rather than ASP.NET. Of course,
in that case, you'd need to generate your dynamic content in an
Include Page or SSI include, and you'd still have to rename the page
from .htm (to .asp in this case.)

I don't see the problem with changing the filename extension from .htm
to .aspx or .asp. Perhaps you can explain why this makes a difference
to you.

What about all those objects that you're able to insert using FrontPage?
How about being able to use that as a mechanism?

They're all static. FrontPage modifies the HTML when it saves the
page, and not whem the Web server delivers the page.
I'm not insisting on a client-side solution. I prefer the server-side
solution, but I don't want to have to rename my master web page to ASPX,
when all I need is this dynamic HTML segment in one small table cell.

I still don't get why changing the filename extension is a big deal.

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

Doug Thews

The difference is that I WANT to create some kind of add-in or control that
FrontPage can consume. Just renaming a FrontPage web page (with it's
FrontPage controls in it) does not smack as "right" to me. Plus, ALL
FrontPage controls that I already have in the web page will go un-processed.
There's got to be a way to build some kind of add-in that FrontPage can
consume.
 
T

Thomas A. Rowe

What type of FP components are currently included in your page that will not work if you rename the
page to .aspx?

Most FP Components are design-time, and the content of the component is saved into the page when you
save it within FP.

Also, what version of FP are you running?

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
J

Jim Buyens

Browse-time FrontPage components work either of two ways.

o In some cases (primarily involving databases) FrontPage creates an
ASP or ASP.NET page. In this case, you can add additional ASP or
ASP.NET
functionality (respectively) to the same page with no problems.

o In all other cases, FrontPage saves the page with an .htm filename
extension, and a program called the "Smart HTML Interpreter" then
processes the outgoing HTML and the incoming Request. This is where
expressions like "--WEBBOT-SELF--" get converted to the names of
legitimate form handlers, and where processing of those forms
occurs.

Now, in your case, it seem you have .htm pages, and so the Smart HTML
Interpreter is at work. Unfortunately, this is compiled a program that
comes with the FrontPage server extensions, and you can't add features
to it. That's why virtually all Web programmers change their pages to
ASP or ASP.NET.

Perhaps it's worth asking what this scrap of dynamic content is, and
how often it changes. Another solution may come to light.

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