.html data file inside an asp.net page?

Discussion in 'ASP .Net' started by jobs at webdos, Oct 13, 2006.

  1. 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?
     
    jobs at webdos, Oct 13, 2006
    #1
    1. Advertising

  2. 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?
    >
    >
     
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tp?=, Oct 15, 2006
    #2
    1. Advertising

  3. jobs at webdos

    jobs Guest

    Re: .html data file inside an asp.net page?

    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?
    > >
    > >
     
    jobs, Oct 19, 2006
    #3
  4. Re: .html data file inside an asp.net page?

    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?
    > > >
    > > >

    >
    >
     
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tp?=, Nov 1, 2006
    #4
    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. Mark Kamoski
    Replies:
    1
    Views:
    7,120
  2. David Dorward
    Replies:
    1
    Views:
    2,133
    Isofarro
    Jun 28, 2003
  3. Dica
    Replies:
    2
    Views:
    601
  4. Chuck
    Replies:
    0
    Views:
    267
    Chuck
    Jul 5, 2003
  5. luu duong
    Replies:
    2
    Views:
    354
    luu duong
    Oct 8, 2003
Loading...

Share This Page