comments inline...

> -----Original Message-----
> From: Furry, Tim [mailto:[EMAIL PROTECTED]] 
> Sent: 06 December 2002 14:55
> To: [EMAIL PROTECTED]
> Subject: [wdvltalk] RE: ASP or VBscript problem
> 
> 
> (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?

Wrong.  Page layout is handled by the HTML mark-up, not the ASP script
processing the data/template.

> 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.  

Ahh, well yes.  For example if you've added/removed some fields from the
datasource then you would have to modify both.  It wouldn't be anymore
time consuming than doing it in the conventional way, I still believe
the time spent flipping between the two files would be a LOT less than
having your HTML and ASP developers trying to work on the same file at
the same time, which does happen in some outfits.  Not all HTML guys do
server-side dev, and vice-versa.

> Seems like a lot of management to me; there might also be a 
> time cost in hitting the hard drive twice (?).

I can't say I've noticed any noticable speed difference.  I don't
believe opening a text file and reading it in to be a particualrly
costly exercise. Hell, if it bothers you why not cache the HTML
templates in the application layer?

>  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 use a separate template for that row of data.  THe page itself being
built up of multiple shared templates.  Yes, not as nice as the one file
but it *does* properly separate the data-code from the presentation
code.

>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.

As above, templates allow page layouts/etc to be easily changed by HTML
developers without them going anywhere near the ASP.
 
> 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

I agree with Tim here, definitely make sure you're using vbCrLf after
all appropriate tags, especially <p>, </p>, </td> and </tr> tags.

In other news I'm sure you'll all be surprised to know It's raining here
in London today.  Nice.

 .b


____ � 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]

Reply via email to