Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
08-15-2011, 07:41 PM #1
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
08-16-2011, 06:47 AM #2
- Join Date
- Feb 2011
- Thanked 395 Times in 395 Posts
If the articles have images in them then you would need to upload those as well.
08-17-2011, 06:03 PM #3
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!
08-17-2011, 07:56 PM #4
- Join Date
- Aug 2006
- Thanked 381 Times in 378 Posts
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.