Dynamically generated page

  • Thread starter Thread starter Matjaz Zalar
  • Start date Start date
M

Matjaz Zalar

Hi,
I have following problem:
1. template content is stored in database string field, for example:

"<HTML><HEAD></HEAD><BODY ID="BODYTAG"></BODY></HTML>

2. page content is also stored in database:

"<div>Hello Problem!!</div>"

3. page.aspx must first load template value and then inserts into template
body innerHTML value of content.

Question:

Is there any possibility to access body through ID:

BODYTAG.innerHTML = "<div>Hello Problem!!</div>"

Thanks for Your reply,


Matjaz Zalar
 
Matjaz,

Yes you can access the body tag from code-behind.

I have sample code on my website: www.aboutfortunate.com. Just go to the
code library and then use the search text box there. Enter "Use body tag as
server control" or something similar and you'll find the sample code.

Any questions? Feel free to email me (Anyone).

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
Thanks,
but your example simply add new generic HTML control. I have already specify
BODY tag in template, so your approach would give me another BODY
tag-control which has no relation to template BODY tag.
 
Matajaz,

You didn't look closely enough. The code doesn't add a second body control
tag. It converts the original into a server side control that can be
manipulated.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
In Your example there is <body> tag in html part of webform. Mine page.aspx
have NO BODY TAG or any one eather! The HTML part is loaded from database
value first for template and then for content.

Matjaz
 
Matjaz,

That's my point. Change your template so that it doesn't add the body tag.
Use a dynamic body tag on the page your template is loading into so that you
can control what you need to.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
Back
Top