Re: loading a html page into a aspx page

Discussion in 'ASP .Net' started by Christopher Ambler, Aug 28, 2003.

  1. 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
    >
    >
    >
    Christopher Ambler, Aug 28, 2003
    #1
    1. Advertising

  2. 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
    > > >
    > > >
    > > >

    > >
    > >

    >
    >
    Christopher Ambler, Aug 28, 2003
    #2
    1. Advertising

  3. "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
    > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    John Saunders, Aug 28, 2003
    #3
  4. 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?
    Christopher Ambler, Aug 28, 2003
    #4
  5. 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
    >
    >
    >
    Christopher Ambler, Aug 28, 2003
    #5
  6. "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
    > >
    > >
    > >

    >
    >
    John Saunders, Aug 28, 2003
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Earl Teigrob
    Replies:
    6
    Views:
    7,842
    wadewalker25
    Sep 28, 2007
  2. =?Utf-8?B?Uk1M?=
    Replies:
    1
    Views:
    532
    =?Utf-8?B?QW5keSBMdWtzaWM=?=
    Sep 16, 2005
  3. Martin P
    Replies:
    0
    Views:
    341
    Martin P
    Nov 14, 2006
  4. =?Utf-8?B?ZXBvd2Vy?=

    No Page_Load event when loading .aspx page into iframe

    =?Utf-8?B?ZXBvd2Vy?=, Oct 10, 2007, in forum: ASP .Net
    Replies:
    7
    Views:
    712
    =?Utf-8?B?ZXBvd2Vy?=
    Oct 11, 2007
  5. ColdAir
    Replies:
    1
    Views:
    751
    JeffP->
    Feb 26, 2009
Loading...

Share This Page