How to insert HTML into a page?

A

AAaron123

I need to have people generate html to place on a page.

In the simplest case it would simply be inserted into a DIV or similar
element.

It would also be nice to insert it into an ajax accordion.

I can't simply insert the entire html because it would have a HEAD and BODY
tag that needs to be stripped.

I'd like the style of the page to be refleced in the inserted data so I
can't use an iframe.

How can I do that.

Or is there a better way to enable non-programmers to provide data for
insertion on to a page?


Thanks
 
G

Gregory A. Beamer

I need to have people generate html to place on a page.

In the simplest case it would simply be inserted into a DIV or similar
element.

It would also be nice to insert it into an ajax accordion.

I can't simply insert the entire html because it would have a HEAD and
BODY tag that needs to be stripped.

I'd like the style of the page to be refleced in the inserted data so
I can't use an iframe.

How can I do that.

Scrape the HTML page from the user and remove the offending sections. If
XHTML, you can use XML objects to do it. With HTML, you still can use
HTML DOM objects.
Or is there a better way to enable non-programmers to provide data for
insertion on to a page?

1. Add a form for the user and use one ofthe open source editing tools.
Then save to a database.

2. Use a CMS (SharePoint, one of hte open source CMSs)

Peace and Grace,
 
A

AAaron123

Gregory said:
Scrape the HTML page from the user and remove the offending sections.
If I know what you mean that is what I do now.
I read the files into a string and then extract the contents of the <body>
Works ok but I was wondring if tere is a more "asp.net" way.

If XHTML, you can use XML objects to do it. With HTML, you still can
use HTML DOM objects.
I don't know how to use DOM to extract the body contents in a .html file
that is not actually the page in the browser. Is that posible?
1. Add a form for the user and use one ofthe open source editing
tools. Then save to a database.

This sounds like it might work for me.

2. Use a CMS (SharePoint, one of hte open source CMSs)

Peace and Grace,


*******************************************
*******************************************

Thanks much
 
G

Gregory A. Beamer

If I know what you mean that is what I do now.
I read the files into a string and then extract the contents of the

I don't know how to use DOM to extract the body contents in a .html
file that is not actually the page in the browser. Is that posible?

It is a bit of a kludge in .NET libraries, unfortunately. The way I have
done it is use the web browser control as an object and pull its HTML
document. You simply serve it a document from a local path instead of
from the web.
This sounds like it might work for me.

FreeTextBox, which Mark suggested, works rather nicely. ;-)

Peace and Grace,
 
A

AAaron123

Gregory said:
It is a bit of a kludge in .NET libraries, unfortunately. The way I
have done it is use the web browser control as an object and pull its
HTML document. You simply serve it a document from a local path
instead of from the web.


FreeTextBox, which Mark suggested, works rather nicely. ;-)

Peace and Grace,


*******************************************
*******************************************

Thanks
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top