472,121 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,121 software developers and data experts.

.html data file inside an asp.net page?

I have a bunch of html pages and a database table with links to them.

I want to dynamically display those pages inside a set location on an
exsisting asp.net 2.0 page when a link is selected, but I don't want to
change the html pages which will contain a duplicate set of <html>
tags.

What's the best way to implement this? WebParts? Does anybody have any
simple example?

Oct 13 '06 #1
3 1725
Howdy,

If i got you right, html content is stored in database (each entry is a
complete html page - <html>...</html>). now, you want to display entries in
one page without affecting page's look and feel (as content consists of
<html>...</html>),. there are two choices
1. <iframe src="htmlGenerator.aspx?contentID=1">
use iframe that points to the aspx page that generates html from database
(remove automatically generated html and use
Reposnse.Write(htmlContentFromdataBase in code behind)) - adventage, you make
sure content is treated as separate page
2. render html content directly to div or any other placeholder i.e.
<div runat="server" id="content1">
code behind: content1.InnerHtml = htmlfromDatabase
However, most of the browsers know taht content containing <html></html>
should be treated specially, (automatically removing
<html><head></head><body></body></htmlif applicable or wrapping content
into iframe)

I hope this helps
--
Milosz Skalecki
MCP, MCAD
"jobs at webdos" wrote:
I have a bunch of html pages and a database table with links to them.

I want to dynamically display those pages inside a set location on an
exsisting asp.net 2.0 page when a link is selected, but I don't want to
change the html pages which will contain a duplicate set of <html>
tags.

What's the best way to implement this? WebParts? Does anybody have any
simple example?

Oct 14 '06 #2
sorry, the html is in a seperate file, what's in the database is the
location of that file. How would I do that?
Milosz Skalecki wrote:
Howdy,

If i got you right, html content is stored in database (each entry is a
complete html page - <html>...</html>). now, you want to display entries in
one page without affecting page's look and feel (as content consists of
<html>...</html>),. there are two choices
1. <iframe src="htmlGenerator.aspx?contentID=1">
use iframe that points to the aspx page that generates html from database
(remove automatically generated html and use
Reposnse.Write(htmlContentFromdataBase in code behind)) - adventage, you make
sure content is treated as separate page
2. render html content directly to div or any other placeholder i.e.
<div runat="server" id="content1">
code behind: content1.InnerHtml = htmlfromDatabase
However, most of the browsers know taht content containing <html></html>
should be treated specially, (automatically removing
<html><head></head><body></body></htmlif applicable or wrapping content
into iframe)

I hope this helps
--
Milosz Skalecki
MCP, MCAD
"jobs at webdos" wrote:
I have a bunch of html pages and a database table with links to them.

I want to dynamically display those pages inside a set location on an
exsisting asp.net 2.0 page when a link is selected, but I don't want to
change the html pages which will contain a duplicate set of <html>
tags.

What's the best way to implement this? WebParts? Does anybody have any
simple example?
Oct 19 '06 #3
Hi Jobs,

private string LoadHtmlFromFile(string path)
{
using (System.IO.StreamReader reader = System.IO.File.OpenText(path))
{
return reader.ReadToEnd();
}
}

Further to my previous post, above function returns content of the text file.

hope this helps
--
Milosz Skalecki
MCAD
"jobs" wrote:
sorry, the html is in a seperate file, what's in the database is the
location of that file. How would I do that?
Milosz Skalecki wrote:
Howdy,

If i got you right, html content is stored in database (each entry is a
complete html page - <html>...</html>). now, you want to display entries in
one page without affecting page's look and feel (as content consists of
<html>...</html>),. there are two choices
1. <iframe src="htmlGenerator.aspx?contentID=1">
use iframe that points to the aspx page that generates html from database
(remove automatically generated html and use
Reposnse.Write(htmlContentFromdataBase in code behind)) - adventage, you make
sure content is treated as separate page
2. render html content directly to div or any other placeholder i.e.
<div runat="server" id="content1">
code behind: content1.InnerHtml = htmlfromDatabase
However, most of the browsers know taht content containing <html></html>
should be treated specially, (automatically removing
<html><head></head><body></body></htmlif applicable or wrapping content
into iframe)

I hope this helps
--
Milosz Skalecki
MCP, MCAD
"jobs at webdos" wrote:
I have a bunch of html pages and a database table with links to them.
>
I want to dynamically display those pages inside a set location on an
exsisting asp.net 2.0 page when a link is selected, but I don't want to
change the html pages which will contain a duplicate set of <html>
tags.
>
What's the best way to implement this? WebParts? Does anybody have any
simple example?
>
>

Nov 1 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by graham.reeds | last post: by
5 posts views Thread by Tomaz Koritnik | last post: by
5 posts views Thread by David Elliott | last post: by
15 posts views Thread by lxyone | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.