Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > .html data file inside an asp.net page?

Reply
Thread Tools

.html data file inside an asp.net page?

 
 
jobs at webdos
Guest
Posts: n/a
 
      10-13-2006
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?

 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWlsb3N6IFNrYWxlY2tp?=
Guest
Posts: n/a
 
      10-15-2006
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></html> if 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?
>
>

 
Reply With Quote
 
 
 
 
jobs
Guest
Posts: n/a
 
      10-19-2006
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></html> if 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?
> >
> >


 
Reply With Quote
 
=?Utf-8?B?TWlsb3N6IFNrYWxlY2tp?=
Guest
Posts: n/a
 
      11-01-2006
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></html> if 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?
> > >
> > >

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Updating a file inside a .war available inside .ear niceguyii Software 0 11-09-2011 01:37 PM
File upload inside a usercontrol inside an updatepanel Leon Mayne ASP .Net 5 05-27-2008 09:02 AM
Problem with inside to inside traffic after upgrading PIX 515 Cisco 5 06-15-2004 06:34 AM
Dynamic temp. datagrid col.gen. -Session access inside a class inside a UserCtrl Andy Eshtry ASP .Net 0 03-01-2004 11:48 PM
Re: Can We Use EXEC CGI Inside a JavaScript Applet Inside an HTML File? David Dorward HTML 1 06-28-2003 09:30 AM



Advertisments