Can I dynamically load html page into my aspx page?

  • Thread starter Thread starter Earl Teigrob
  • Start date Start date
E

Earl Teigrob

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
 
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
 
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
 
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.
 
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
 
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
 
Back
Top