|
|||||||
| .NET Discussion and technical support for, building, using and deploying .NET sites. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
display static html file in div tag...how?
.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! |
|
#2
|
||||
|
||||
|
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.
__________________
WAR EAGLE! 4 guys rolla (some good asp.net articles)|A browser hack chart, very handy |
|
#3
|
|||
|
|||
|
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! |
|
#4
|
||||
|
||||
|
Well you could write out the file manually, but replace all of the bad tags with "".
__________________
WAR EAGLE! 4 guys rolla (some good asp.net articles)|A browser hack chart, very handy |
|
#5
|
|||
|
|||
|
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.
|
|
#6
|
||||
|
||||
|
Quote:
__________________
WAR EAGLE! 4 guys rolla (some good asp.net articles)|A browser hack chart, very handy |
|
#7
|
|||
|
|||
|
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. |
|
#8
|
||||
|
||||
|
I am one of those anti iframe activists.
__________________
WAR EAGLE! 4 guys rolla (some good asp.net articles)|A browser hack chart, very handy |
|
#9
|
|||
|
|||
|
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!
|
|
#10
|
||||
|
||||
|
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.
__________________
WAR EAGLE! 4 guys rolla (some good asp.net articles)|A browser hack chart, very handy |
|
#11
|
|||
|
|||
|
How To Load External Html Document Into the Web Page using Asp.Net
|
|
#12
|
|||
|
|||
|
check this article:
http://sevenadoo.com/AspNet-d1/How-T...AspNet-c2.aspx |
|
#13
|
|||
|
|||
|
Assuming you can't modify the output format the one solution I can think of is to create a user web control and on the code behind make the request to the source page then drop the extra tags as mentioned above. Just output it in a asp:Literal or asp:Label if you wish.
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|