Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-15-2011, 06:41 PM   PM User | #1
alykins
Senior Coder

 
alykins's Avatar
 
Join Date: Apr 2011
Posts: 1,608
Thanks: 37
Thanked 183 Times in 182 Posts
alykins will become famous soon enough
consequences of multiple <head>&<body>

let me describe what is going on here first. I have a page that has an admin UI that will allow the admins to upload article from national association of school psychologists (NASP). These articles are written in a "standard" html format using <head> and <body> regions.

Now my initial thought were to allow the user to upload and then i transfer the entire .html document as text to my DB. Then when the client user selects an item from a drop down, I have it throw all that code into a text field, so to keep all the styling and formatting NASP has done (and to save me from rewriting 40+ documents and more than that if you factor in future releases).

The problem with that is then you would have multiple occurrences of <head> and <body> tags. This I presume will cause errors in viewing. My other thought was to take and throw all of that into an iframe... Does anyone know if an iframe supports in lieu of a source something.com it would support a DB call?

Is this making sense? My other thoughts were to take the file and parse through and extract all the content between the <body> tags, but I am wondering if that would give a lot of lag time.... ideas would be great (if you have ideas on the alternatives)... my original question though is if the multiple <head><body> tags would throw problems and also if the iframe idea is feasible
__________________

I code C hash-tag .Net
Reference: W3C W3CWiki .Net Lib
Validate: html CSS
Debug: Chrome FireFox IE
alykins is offline   Reply With Quote
Old 08-16-2011, 05:47 AM   PM User | #2
bullant
Banned

 
Join Date: Feb 2011
Posts: 2,699
Thanks: 13
Thanked 395 Times in 395 Posts
bullant is on a distinguished road
Assuming all the html/css/javascript for an article is contained in a single html file then you should be able to upload the html file as a text file via a <form> and move it to a designated folder on the web server. You can then link to that html file via an <iframe>'s src.

If the articles have images in them then you would need to upload those as well.
bullant is offline   Reply With Quote
Old 08-17-2011, 05:03 PM   PM User | #3
alykins
Senior Coder

 
alykins's Avatar
 
Join Date: Apr 2011
Posts: 1,608
Thanks: 37
Thanked 183 Times in 182 Posts
alykins will become famous soon enough
Quote:
Originally Posted by bullant View Post
Assuming all the html/css/javascript for an article is contained in a single html file then you should be able to upload the html file as a text file via a <form> and move it to a designated folder on the web server. You can then link to that html file via an <iframe>'s src.

If the articles have images in them then you would need to upload those as well.
took me a while to get back to this...
side note... when did bullant get banned?

Anyways if anyone is following what he is saying I kinda like that idea. If I am understanding what he was saying (I realize I may not get an answer since he isnt here anymore but..) basically on my button click or whatever I would do my DB call and populate the entire page of lets say info.aspx (which until this point would be completely blank) then on that same page have an iframe with a source of something like src="~./Forms/info.aspx" and then either on my navigation away from that page or another button click wipe that info.aspx page blank removing all the data from it... and then somehow lock users from being able to goto that page (because it wouldnt really have any "style" to it and wouldnt want people going there)...

I think i am just talking outloud... but if anyone was following my thought train and bullant's, and they agree (or disagree) let me know!
thanks
__________________

I code C hash-tag .Net
Reference: W3C W3CWiki .Net Lib
Validate: html CSS
Debug: Chrome FireFox IE
alykins is offline   Reply With Quote
Old 08-17-2011, 06:56 PM   PM User | #4
tracknut
Regular Coder

 
Join Date: Aug 2006
Posts: 892
Thanks: 4
Thanked 206 Times in 205 Posts
tracknut is an unknown quantity at this point
You don't say whether there's any security needed on these files, so I'll assume not. I would upload the documents to some folder (let's say /docs) and only put their titles and a link to them in the database, not the document itself. Then you could have a displaydoc.aspx page, which presented all the docs available (by grabbing the list from the db at run-time) and had an iframe for where the doc would get displayed. The src of that iframe would be generated by the asp code as the user selected a particular document.

Dave
tracknut is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:24 AM.


Advertisement
Log in to turn off these ads.