How to insert HTML into a page?

  • Thread starter Thread starter AAaron123
  • Start date Start date
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
 
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,

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

My vacation and childhood cancer awareness site:
http://www.crazycancertour.com

*******************************************
| Think outside the box! |
*******************************************
 
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
 
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,

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

My vacation and childhood cancer awareness site:
http://www.crazycancertour.com

*******************************************
| Think outside the box! |
*******************************************
 
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
 
Back
Top