Can I dynamically load html page into my aspx page?

Discussion in 'ASP .Net' started by Earl Teigrob, Mar 3, 2004.

  1. Earl Teigrob

    Earl Teigrob Guest

    I am creating an application where I would like to give web designers the
    ablity to create a static html page and dyanamically load it into my
    application(exactly like loading a user control into a page). Is there an
    easy way to do this or do I need to stream the html into my application and
    parse unwanted header/footer info before rendering it within the application
    page (as a literal control, i imagine)

    Has anyone done this or seen any reference material on doing such a thing?

    Thanks

    Earl
     
    Earl Teigrob, Mar 3, 2004
    #1
    1. Advertising

  2. check out RegisterStartupScript block function.....

    RegisterStartupScript

    ************************

    Sub InsertScriptBlock(ByVal strItem As String)

    Dim jScript As New System.Text.StringBuilder

    jScript.Append("<script language=""JavaScript"">")

    jScript.Append("location.href=""#")

    jScript.Append(strItem)

    jScript.Append(""";")

    jScript.Append("<" & "/script>")


    Me.RegisterClientScriptBlock("Bookmark", jScript.ToString())

    End Sub

    "Earl Teigrob" <> wrote in message
    news:...
    > I am creating an application where I would like to give web designers the
    > ablity to create a static html page and dyanamically load it into my
    > application(exactly like loading a user control into a page). Is there an
    > easy way to do this or do I need to stream the html into my application

    and
    > parse unwanted header/footer info before rendering it within the

    application
    > page (as a literal control, i imagine)
    >
    > Has anyone done this or seen any reference material on doing such a thing?
    >
    > Thanks
    >
    > Earl
    >
    >
     
    Harry Simpson, Mar 3, 2004
    #2
    1. Advertising

  3. Earl Teigrob

    Earl Teigrob Guest

    Harry,

    Thanks for the reply, however, I would like the html page included in my
    aspx page. I am not trying to create a link to the page, or redirrect the
    user to the html page. I want the page to be loaded into my aspx page like a
    user control can be loaded into a aspx page. The html page need to be
    embeded in my aspx page.

    Thanks

    Earl



    "Harry Simpson" <> wrote in message
    news:...
    > check out RegisterStartupScript block function.....
    >
    > RegisterStartupScript
    >
    > ************************
    >
    > Sub InsertScriptBlock(ByVal strItem As String)
    >
    > Dim jScript As New System.Text.StringBuilder
    >
    > jScript.Append("<script language=""JavaScript"">")
    >
    > jScript.Append("location.href=""#")
    >
    > jScript.Append(strItem)
    >
    > jScript.Append(""";")
    >
    > jScript.Append("<" & "/script>")
    >
    >
    > Me.RegisterClientScriptBlock("Bookmark", jScript.ToString())
    >
    > End Sub
    >
    > "Earl Teigrob" <> wrote in message
    > news:...
    > > I am creating an application where I would like to give web designers

    the
    > > ablity to create a static html page and dyanamically load it into my
    > > application(exactly like loading a user control into a page). Is there

    an
    > > easy way to do this or do I need to stream the html into my application

    > and
    > > parse unwanted header/footer info before rendering it within the

    > application
    > > page (as a literal control, i imagine)
    > >
    > > Has anyone done this or seen any reference material on doing such a

    thing?
    > >
    > > Thanks
    > >
    > > Earl
    > >
    > >

    >
    >
     
    Earl Teigrob, Mar 3, 2004
    #3
  4. This is exactly how http://office.microsoft.com loads some of our content
    pages. It's pretty simple-- you just Response.Write the content of the .HTM
    into the body. You'd want to strip out everything but what's inside the
    <BODY> element.

    Alternatively, you could just use an IFRAME, but that doesn't sound like an
    option for you.

    --
    Thanks,

    Eric Lawrence
    Program Manager
    Assistance and Worldwide Services

    This posting is provided "AS IS" with no warranties, and confers no rights.


    "Earl Teigrob" <> wrote in message
    news:...
    > Harry,
    >
    > Thanks for the reply, however, I would like the html page included in my
    > aspx page. I am not trying to create a link to the page, or redirrect the
    > user to the html page. I want the page to be loaded into my aspx page like

    a
    > user control can be loaded into a aspx page. The html page need to be
    > embeded in my aspx page.
    >
    > Thanks
    >
    > Earl
    >
    >
    >
    > "Harry Simpson" <> wrote in message
    > news:...
    > > check out RegisterStartupScript block function.....
    > >
    > > RegisterStartupScript
    > >
    > > ************************
    > >
    > > Sub InsertScriptBlock(ByVal strItem As String)
    > >
    > > Dim jScript As New System.Text.StringBuilder
    > >
    > > jScript.Append("<script language=""JavaScript"">")
    > >
    > > jScript.Append("location.href=""#")
    > >
    > > jScript.Append(strItem)
    > >
    > > jScript.Append(""";")
    > >
    > > jScript.Append("<" & "/script>")
    > >
    > >
    > > Me.RegisterClientScriptBlock("Bookmark", jScript.ToString())
    > >
    > > End Sub
    > >
    > > "Earl Teigrob" <> wrote in message
    > > news:...
    > > > I am creating an application where I would like to give web designers

    > the
    > > > ablity to create a static html page and dyanamically load it into my
    > > > application(exactly like loading a user control into a page). Is there

    > an
    > > > easy way to do this or do I need to stream the html into my

    application
    > > and
    > > > parse unwanted header/footer info before rendering it within the

    > > application
    > > > page (as a literal control, i imagine)
    > > >
    > > > Has anyone done this or seen any reference material on doing such a

    > thing?
    > > >
    > > > Thanks
    > > >
    > > > Earl
    > > >
    > > >

    > >
    > >

    >
    >
     
    Eric Lawrence [MSFT], Mar 4, 2004
    #4
  5. Earl Teigrob

    Earl Teigrob Guest

    Thanks Eric.

    I imagine this is almost identical to doing a screen scrape, but replacing
    all relative references with absolute ones, and striping away unwanted data
    and tags (for example, the form tags) . That part I think I can do without
    to much problem.

    Do you ( or anyone else) know of any resources/technical papers on doing
    this sort of thing that may cover some (or all) the modifications that would
    be required to the html stream before displaying it in the body of my aspx
    page? (Im sure someone has already written the "PrepareHtmlForDisplay" class
    that does the work)

    (In other words, can I get spoon feed on how to do this so I don't have to
    think to hard! :)

    Earl


    "Eric Lawrence [MSFT]" <> wrote in message
    news:O6xI%...
    > This is exactly how http://office.microsoft.com loads some of our content
    > pages. It's pretty simple-- you just Response.Write the content of the

    ..HTM
    > into the body. You'd want to strip out everything but what's inside the
    > <BODY> element.
    >
    > Alternatively, you could just use an IFRAME, but that doesn't sound like

    an
    > option for you.
    >
    > --
    > Thanks,
    >
    > Eric Lawrence
    > Program Manager
    > Assistance and Worldwide Services
    >
    > This posting is provided "AS IS" with no warranties, and confers no

    rights.
    >
    >
    > "Earl Teigrob" <> wrote in message
    > news:...
    > > Harry,
    > >
    > > Thanks for the reply, however, I would like the html page included in my
    > > aspx page. I am not trying to create a link to the page, or redirrect

    the
    > > user to the html page. I want the page to be loaded into my aspx page

    like
    > a
    > > user control can be loaded into a aspx page. The html page need to be
    > > embeded in my aspx page.
    > >
    > > Thanks
    > >
    > > Earl
    > >
    > >
    > >
    > > "Harry Simpson" <> wrote in message
    > > news:...
    > > > check out RegisterStartupScript block function.....
    > > >
    > > > RegisterStartupScript
    > > >
    > > > ************************
    > > >
    > > > Sub InsertScriptBlock(ByVal strItem As String)
    > > >
    > > > Dim jScript As New System.Text.StringBuilder
    > > >
    > > > jScript.Append("<script language=""JavaScript"">")
    > > >
    > > > jScript.Append("location.href=""#")
    > > >
    > > > jScript.Append(strItem)
    > > >
    > > > jScript.Append(""";")
    > > >
    > > > jScript.Append("<" & "/script>")
    > > >
    > > >
    > > > Me.RegisterClientScriptBlock("Bookmark", jScript.ToString())
    > > >
    > > > End Sub
    > > >
    > > > "Earl Teigrob" <> wrote in message
    > > > news:...
    > > > > I am creating an application where I would like to give web

    designers
    > > the
    > > > > ablity to create a static html page and dyanamically load it into my
    > > > > application(exactly like loading a user control into a page). Is

    there
    > > an
    > > > > easy way to do this or do I need to stream the html into my

    > application
    > > > and
    > > > > parse unwanted header/footer info before rendering it within the
    > > > application
    > > > > page (as a literal control, i imagine)
    > > > >
    > > > > Has anyone done this or seen any reference material on doing such a

    > > thing?
    > > > >
    > > > > Thanks
    > > > >
    > > > > Earl
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    Earl Teigrob, Mar 4, 2004
    #5
  6. Earl Teigrob

    Stanley Guest

    I do something like this but I use a WYSIWYG control to do the building of
    the HTML and then store the text directly into a field in a database. You
    could actually write it to a text file or whatever. Then when the page loads
    it looks for the right text and simply loads the HTML by using a
    LiteralControl being added to something like a PlaceHolder or Panel.

    PlaceHolder.Controls.Add(New LiteralControl(myTextPulledFromDatabase))

    -Stanley

    "Earl Teigrob" <> wrote in message
    news:...
    > I am creating an application where I would like to give web designers the
    > ablity to create a static html page and dyanamically load it into my
    > application(exactly like loading a user control into a page). Is there an
    > easy way to do this or do I need to stream the html into my application

    and
    > parse unwanted header/footer info before rendering it within the

    application
    > page (as a literal control, i imagine)
    >
    > Has anyone done this or seen any reference material on doing such a thing?
    >
    > Thanks
    >
    > Earl
    >
    >
     
    Stanley, Mar 4, 2004
    #6
  7. Earl Teigrob

    wadewalker25

    Joined:
    Sep 28, 2007
    Messages:
    1
    Can you post an example of how you solved this?

    I'm running into the exact scenario and was wondering how you solved this?
     
    wadewalker25, Sep 28, 2007
    #7
    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. Hose B
    Replies:
    1
    Views:
    3,906
    Scott Allen
    Jul 2, 2004
  2. David Virgil Hobbs
    Replies:
    2
    Views:
    17,269
  3. ColdAir
    Replies:
    1
    Views:
    788
    JeffP->
    Feb 26, 2009
  4. ste-m
    Replies:
    1
    Views:
    326
  5. Duke
    Replies:
    1
    Views:
    170
    Tom de Neef
    Apr 18, 2008
Loading...

Share This Page