(Sorry for the response delay, I'm on the WDVL digest) Ben "failing that" wrote: failing that, build your HTML pages as templates and read them in using the FSO, replacing 'fields' in the mark-up, such [this] and [that], with real data at run-time.
this has two advantages over Context-Switching and Server-Side HTML generation: you can continue to build the HTML without interfering with the ASP, and the ASP code isn't tied down to pay particualr page layouts, formatting, etc. Tim: Interesting concept - one I hadn't thought of. A couple of questions come immediately to mind though. First, this means you're having to modify two files instead of one when a page layout changes, right? You'll need to change the ASP page (assuming you've added or removed dynamic content from the output page), and you'll have to change the HTML template. Seems like a lot of management to me; there might also be a time cost in hitting the hard drive twice (?). Second, can this method handle variable-length lists? For instance, I query a database for a list of users, and want to display them...but the HTML page doesn't know how many there are so I can't put in a series of "[username]" TDs to replace...I suppose you could put a "[usernamelist]" in the HTML and have the ASP tack in the HTML along with the data, but then that begs the question of why we're doing two pages. Tim said, previously: I also take the time to go back and View Source from the browser after I've converted to Response.Writes, just to make sure the HTML is getting indented nicely and looks good. I am different than JR in the fact that I have the ASP kick out the extra whitespace to retain the HTML formatting - it's one more way to make debugging easier on myself. Casey asked: Now you have my attention! I also use lots of switches while developing but then wrap it all in response.write for production. But I've always been frustrated because the View Source of the production version has no white space in the HTML... It's all one long string. HOW do you prevent this? Tim: As Ben said, using the vbCrLf at the end of lines - and sometimes in the middle, too: Response.Write " </TD>" & vbcrlf & " </TR>" & vbcrlf & "</TABLE>" & vbcrlf & "<!-- End Main Table -->" & vbcrlf & vbcrlf Casey: Well, All bee! Perry: You didn't finish the statement. Did you mean, "Well, All bee DIM ed? ;) Tim: LOL! Excellent comeback. :-) If you like, you can View Source on www.foulston.com pages to see how it works - I'd guess that probably 98% of the pages are generated with ASP, rather than HTML directly. The front pages (Home, Welcome, etc.) are mostly static HTML, but once you get into the data-driven pages almost everything is produced using ASP Response.Writes. The end result is no different than a well-formatted HTML page. Tim ___________________________ Tim Furry Web Developer Foulston Siefkin LLP ____ � The WDVL Discussion List from WDVL.COM � ____ To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] Send Your Posts To: [EMAIL PROTECTED] To change subscription settings to the wdvltalk digest version: http://wdvl.internet.com/WDVL/Forum/#sub ________________ http://www.wdvl.com _______________________ You are currently subscribed to wdvltalk as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED]
