473,387 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 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 1776
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dr. StrangeDub | last post by:
I am looking for a way to capture the HTML file generated by an ASP.Net application (just as is sent back to the client) and save it to a designated spot on the web server. Here's a bit of...
16
by: graham.reeds | last post by:
I am updating a website that uses a countdown script embedded on the page. When the page is served the var's are set to how long the countdown has left in minutes and seconds, but the rest of the...
5
by: Tomaz Koritnik | last post by:
Hi I have many short HTML files stored in a binary stream storage to display descriptions for various items in application. HTML would be display inside application using some .NET control or...
5
by: David Elliott | last post by:
I need a control on a Web Page that can accept an HTML Document and will display it. Any help would be appreciated. Thanks, Dave Here is what I was trying...
4
by: Vlady | last post by:
Hello. I recently built an ASP.NET "financial" application. I got to the point where I have a HTML template (a contract) which needs to be filled with various data from the database. I put a...
6
by: Paolo Pignatelli | last post by:
I have an aspx code behind page that goes something like this in the HTML view: <asp:HyperLink id=HyperLink1 runat="server" NavigateUrl='<%#"mailto:" &amp;...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
10
by: CDFTim | last post by:
O.K. that was a long Title... Can you help / show me how I would......... I am going to long windedly try to paint this picture. Backround: I have an html page that has a marquee function in it to...
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.