Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,776
    Thanks
    41
    Thanked 196 Times in 195 Posts

    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

  • #2
    Banned
    Join Date
    Feb 2011
    Posts
    2,699
    Thanks
    13
    Thanked 395 Times in 395 Posts
    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.

  • #3
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,776
    Thanks
    41
    Thanked 196 Times in 195 Posts
    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

  • #4
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,311
    Thanks
    11
    Thanked 284 Times in 283 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.

    Dave


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •