Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: loading a html page into a aspx page

Reply
Thread Tools

Re: loading a html page into a aspx page

 
 
Christopher Ambler
Guest
Posts: n/a
 
      08-28-2003
Or, alternatively, use a "div" tag, runat server, and set the InnerHtml
property in the load function.

Christopher

"John Saunders" <> wrote in message
news:...
> "Brian Henry" <> wrote in message
> news:...
> > I have a page writen as an aspx page, now this is a template... i want

to
> be
> > able to make HTML files that will show up in the document are of the

aspx
> > page based on a database index... how do i render the HTML file into the
> > aspx page's main text area? thanks! (remember this is a template like
> > cnn.com or something, where the HTML file would be the story)

>
> One way would be to make these HTML files be user controls, then use
> LoadControl to load them into your template page.
>
> Another way would be to use an <iframe> and set the src attribute to point
> to the html page.
> --
> John Saunders
> Internet Engineer
>
>
>



 
Reply With Quote
 
 
 
 
Christopher Ambler
Guest
Posts: n/a
 
      08-28-2003
Absolutely correct, it would.

In this case, I'd put something in my code that checked for that and
stripped it down to whatever is inside of the body, perhaps taking some of
the body arguments (like bgcolor and the like) and making a style for the
div out of it. Set the appropriate properties on the div and load the
InnerHtml and away you go.

Your solution, with a web control, might be a better one in this case,
however. In my solution, I'd expect that the HTML coming out of the DB is
such that it's ready to be placed in the div.

Christopher

"John Saunders" <> wrote in message
news:...
> Christopher,
>
> I wonder if your method might not have a problem in some browsers when the
> imported HTML file is complete - !DOCTYPE, <HTML>, <HEAD> and <BODY>? The
> <iframe> takes care of that problem.
>
> BTW, when I mentioned user controls, I meant that the user controls should
> not have all the above HTML header junk.
> --
> John Saunders
> Internet Engineer
>
>
> "Christopher Ambler" <> wrote in message
> news:...
> > Or, alternatively, use a "div" tag, runat server, and set the InnerHtml
> > property in the load function.
> >
> > Christopher
> >
> > "John Saunders" <> wrote in message
> > news:...
> > > "Brian Henry" <> wrote in message
> > > news:...
> > > > I have a page writen as an aspx page, now this is a template... i

want
> > to
> > > be
> > > > able to make HTML files that will show up in the document are of the

> > aspx
> > > > page based on a database index... how do i render the HTML file into

> the
> > > > aspx page's main text area? thanks! (remember this is a template

like
> > > > cnn.com or something, where the HTML file would be the story)
> > >
> > > One way would be to make these HTML files be user controls, then use
> > > LoadControl to load them into your template page.
> > >
> > > Another way would be to use an <iframe> and set the src attribute to

> point
> > > to the html page.
> > > --
> > > John Saunders
> > > Internet Engineer
> > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
 
John Saunders
Guest
Posts: n/a
 
      08-28-2003
"Christopher Ambler" <> wrote in message
news:eJ$...
> Absolutely correct, it would.
>
> In this case, I'd put something in my code that checked for that and
> stripped it down to whatever is inside of the body, perhaps taking some of
> the body arguments (like bgcolor and the like) and making a style for the
> div out of it. Set the appropriate properties on the div and load the
> InnerHtml and away you go.
>
> Your solution, with a web control, might be a better one in this case,
> however. In my solution, I'd expect that the HTML coming out of the DB is
> such that it's ready to be placed in the div.


That depends on where it's coming from, of course.

Do you know of any problem with my <iframe> solution?
--
John Saunders
Internet Engineer


> Christopher
>
> "John Saunders" <> wrote in message
> news:...
> > Christopher,
> >
> > I wonder if your method might not have a problem in some browsers when

the
> > imported HTML file is complete - !DOCTYPE, <HTML>, <HEAD> and <BODY>?

The
> > <iframe> takes care of that problem.
> >
> > BTW, when I mentioned user controls, I meant that the user controls

should
> > not have all the above HTML header junk.
> > --
> > John Saunders
> > Internet Engineer
> >
> >
> > "Christopher Ambler" <> wrote in message
> > news:...
> > > Or, alternatively, use a "div" tag, runat server, and set the

InnerHtml
> > > property in the load function.
> > >
> > > Christopher
> > >
> > > "John Saunders" <> wrote in message
> > > news:...
> > > > "Brian Henry" <> wrote in message
> > > > news:...
> > > > > I have a page writen as an aspx page, now this is a template... i

> want
> > > to
> > > > be
> > > > > able to make HTML files that will show up in the document are of

the
> > > aspx
> > > > > page based on a database index... how do i render the HTML file

into
> > the
> > > > > aspx page's main text area? thanks! (remember this is a template

> like
> > > > > cnn.com or something, where the HTML file would be the story)
> > > >
> > > > One way would be to make these HTML files be user controls, then use
> > > > LoadControl to load them into your template page.
> > > >
> > > > Another way would be to use an <iframe> and set the src attribute to

> > point
> > > > to the html page.
> > > > --
> > > > John Saunders
> > > > Internet Engineer
> > > >
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Christopher Ambler
Guest
Posts: n/a
 
      08-28-2003
Other than the inherant security risks, no.

Christopher

"John Saunders" <> wrote in message
news:...
> "Christopher Ambler" <> wrote in message
> news:eJ$...
> > Absolutely correct, it would.
> >
> > In this case, I'd put something in my code that checked for that and
> > stripped it down to whatever is inside of the body, perhaps taking some

of
> > the body arguments (like bgcolor and the like) and making a style for

the
> > div out of it. Set the appropriate properties on the div and load the
> > InnerHtml and away you go.
> >
> > Your solution, with a web control, might be a better one in this case,
> > however. In my solution, I'd expect that the HTML coming out of the DB

is
> > such that it's ready to be placed in the div.

>
> That depends on where it's coming from, of course.
>
> Do you know of any problem with my <iframe> solution?



 
Reply With Quote
 
Christopher Ambler
Guest
Posts: n/a
 
      08-28-2003
Sure, and as long as you can be sure that nobody else can sneak HTML into
the database from which the iframe's content is retreived, you're fine.

Christopher

"John Saunders" <> wrote in message
news:%...
> "Christopher Ambler" <> wrote in message
> news:...
> > Other than the inherant security risks, no.

>
> Ok, what security risks? I'm talking about an iframe pointing to another
> file on the same server.
> --
> John Saunders
> Internet Engineer
>
>
>



 
Reply With Quote
 
John Saunders
Guest
Posts: n/a
 
      08-28-2003
"Christopher Ambler" <> wrote in message
news:%...
> Sure, and as long as you can be sure that nobody else can sneak HTML into
> the database from which the iframe's content is retreived, you're fine.


Ok, thanks, Christopher. I was worrying that I was missing something.

Although I'm not the original poster, I may actually be implementing
something like this fairly soon. And the database it's getting the HTML from
is secure.
--
John Saunders
Internet Engineer


> Christopher
>
> "John Saunders" <> wrote in message
> news:%...
> > "Christopher Ambler" <> wrote in message
> > news:...
> > > Other than the inherant security risks, no.

> >
> > Ok, what security risks? I'm talking about an iframe pointing to another
> > file on the same server.
> > --
> > John Saunders
> > Internet Engineer
> >
> >
> >

>
>



 
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
Dynamically add aspx snippet into a given aspx page ColdAir ASP .Net 1 02-26-2009 12:49 AM
No Page_Load event when loading .aspx page into iframe =?Utf-8?B?ZXBvd2Vy?= ASP .Net 7 10-10-2007 11:21 PM
Loading an .aspx-page into a System.Web.UI.Page object? Martin P ASP .Net 0 11-14-2006 08:26 PM
Enbedding aspx page into another aspx page and post back Naga_01 Software 0 06-06-2006 05:51 AM
Loading an aspx page in a fram from another aspx page =?Utf-8?B?Uk1M?= ASP .Net 1 09-16-2005 01:21 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57