Click to See Complete Forum and Search --> : display static html file in div tag...how?
mcrpds
12-07-2004, 01:59 PM
.net gurus,
i am building a web page and i want to display an html file. i created a div tag as follows:
<DIV id="container" align="center" style="Z-INDEX: 104; LEFT: 150px; WIDTH: 440px; POSITION: absolute; TOP: 41px; HEIGHT: 728px" dataSrc='"c:\inetput\wwwroot\report\html\chart21.html"'></DIV>
this does not work, can anyone please help or suggest an alternative solution. thank you in advance!
PeOfEo
12-07-2004, 08:22 PM
The easiest way is to just do a server side include.
http://www.w3schools.com/asp/asp_incfiles.asp
That example is for asp classic, but asp classic and asp.net share the same syntax for including, that syntax is the same for SSI too.
You can include anything like this that is a standard ascii file (.inc, .asp, .htm, .txt, so on and so fourth). But do not put <head><body><html> tags in the code, as this will write all of the contents of the external file directly where you put the include code, so you will consequently have two <html> tags or something if you do that. This will cause havoc on your pages.
mcrpds
12-08-2004, 09:04 AM
PeOfEo,
Thanks for the ideal. The static files of this report is from crystal (exported as html), it works great for the first page (include) but the <<next>> page links just overwrite all of my graphics since it is an html file on the anchor tag. If you know of another possible solution or approach, I would be all ears. Thanks again for your time!
PeOfEo
12-08-2004, 06:51 PM
Well you could write out the file manually, but replace all of the bad tags with "".
Cstick
12-11-2004, 07:52 PM
Look into using Page.Response. http://www.devx.com/tips/Tip/18010 Basically you could do exactly what that article explains except you'd be exporting as an HTML file.
PeOfEo
12-11-2004, 10:06 PM
Originally posted by Cstick
Look into using Page.Response. http://www.devx.com/tips/Tip/18010 Basically you could do exactly what that article explains except you'd be exporting as an HTML file. He could do that, but he would still need to parse through the document and drop all of the extra tags so he is going to need to get this thing into the form of a string and run some replace statements.
Cstick
12-12-2004, 08:32 AM
Assumming that the hyperlinked images appear properly when browsed to in their current location. Perhaps he could use an iFrame to display the file.
Another alternative, he could use either of the methods that you or I suggested previously, however he could have Crystal export the HTML file with absolute URL's to the images and hyperlinks.
PeOfEo
12-12-2004, 09:10 AM
I am one of those anti iframe activists. ;)
mcrpds
12-12-2004, 09:42 AM
i was thinking iframes would basically solve the problem, but why are so many programmers down on framesets? also i was thinking of using master pages, i saw a website www.wilsondotnet.com that may possibly be a solution to this mess. thanks for so many responses and ideas!
PeOfEo
12-12-2004, 07:48 PM
The reason people are not fond of iframes (or frames in general) is because they hurt your ability to design, they are not too user friendly, and they kill accessibility.