display an html file within a web form?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I need to open an html file from the file system and embed that html file
within my main aspx form.
I have 2 questions:
1) How do I open the html file? I tried the File.open(Path, mode) didnt work.
2) I would like to display the html file at a certain location in my main
aspx page. How can I achieve this?
I'm brain dead and I have to finish this tonight! Please help.

Thanks
V
 
Hi Peter
I dont know what the ramifications are using iframe vs embedded in the
page. I need to wrap this html document around an image. I've never used
iframes before. Is it a .net control? Can I access the iframe from the
codebehind page? Pls advise me.

THanks
V
 
An iframe is a standard HTML element... do a search for it online. But, I
don't think it's in the VS toolbox. You can add it manually to the web form
(by switching to html View)... AND you can access the iframe from the
code-behind by adding the runat="server" attribute to it.

Having said that... you can just dump the contents of the html file into a
label or panel control. AFAIK all browsers know how to deal with nested
<HTML> and <BODY> tags and that shouldn't confuse them (though it might
violate some standards... I'm not sure).
 
Thanks CMM.
I currently have the html file set to a literal control and it doesn't
wrap around the image. It acts like the html and image are in two different
table cells. I will try the iframe and try to embed the image as well in the
iframe and see if it works.

Thanks,
V
 
You can try embedding the html together with the image's <img> tag in a label
(or maybe literal control?) control. It should wrap then.
iFrames are stoic... and hard to control their exact placement (they're
essentially floating frames).
 
Back
Top