In that case, avoid changing between ASP / HTML. As in, the second way, it swaps between them. If you're looping through a recordset, keep it all in ASP code for speed.