By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,387 Members | 1,729 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,387 IT Pros & Developers. It's quick & easy.

.html data file inside an asp.net page?

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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.