Doug Murphy
dw-murphy at cox.net
Fri Jan 9 11:51:12 CST 2004
Hi Drew, Yes I use this approach when writing pages that are the ASP version of a continuous form, e.g., many records listed in form controls. The if/else/then structure allows for testing for conditions and then writing the correct html. I think I first saw this in one of the ASP books I use, or it may have been some code I got off the web. I'll take it from wherever I find it. Doug -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of DWUTKA at marlow.com Sent: Thursday, January 08, 2004 11:59 AM To: AccessD at databaseadvisors.com Subject: [AccessD] OT: ASP Oddity Sorry for the OT post, but I ran into this last month, and was just flabbergasted that this worked this way. I was doing an ASP sub-contract for my sister, for a jewelry company (http://edlevinjewelry.com) . In the HTML of some of the pages, I found stuff like this: <% If so.type="merchant" then %> <b>This is a test</b> <% End if%> It wasn't coded (or worded, obviously) like that, but that is the gist of it. There was an If Then clause, with regular old HTML in the middle. Sure enough, if the criteria isn't met, the HTML isn't displayed. I never realized (until I saw that), that you could do that. Up until now, I have always done something like this: <% If This=True Then response.write "<b>Test</b>" End if %> In that case, the ASP is writing out the HTML. In some cases, it doesn't make much of a difference. However, I write most of my HTML by hand, using the Microsoft Script Editor, which does a lot of autocompletion, and makes writing raw HTML a breeze. But when I had to put out conditional HTML, I lost all of the advantages of the editor, because I was putting the HTML into a string. What's odd, is I have never run across this in ASP documentation. Once again, sorry for the OT post, but I know there are several listers out there that are either starting out in ASP, or have been using it for a while, and hopefully, this will be helpful to ya'all. Just out of curiousity, did anyone else know this? Drew _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com