Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 05, 2013 03:13 AM by senthilwaits
Jan 04, 2013 08:45 PM|LINK
I'm a beginner in ASP.net.
I have an ASP.net page in which I'd like to display another html page in a div. I have the file WeeklyReturns.html together with its associated folder WeeklyReturns(containg images to be rendered with the page) located in a virtual path (~/UploadFiles) in
the project root folder. When I right-click to browse WeeklyReturns.html, the page is perfectly rendered in IE or Firefox.
And so I expect the following VB.net click event code (of a button) to display the html in a div on my parent ASP page:
Me.divHTML.InnerHTML = System.IO.File.ReadAllText(Server.MapPath("~/UploadFiles/WeeklyReturns.html"), Encoding.Default)
Unfortunately, nothing is displayed; I've tried several experiments with InnerText, Encoding.???, all to no avail.
Could someone pls offer some solution.
Jan 05, 2013 02:57 AM|LINK
Why you don't insted trying to fill the div with html content to put iframe inside of this div and set the iframe src="" url (make the iframe server control adding id="myid" runat="server").
Jan 05, 2013 03:13 AM|LINK
You can use jQuery to achieve this. But make sure, you don't have HTML, BODY and HEAD tags in your HTML page just the content of the BODY.