DWUTKA at marlow.com
DWUTKA at marlow.com
Thu Jan 8 13:59:04 CST 2004
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