I have a style variable below that I can't figure correct quotes for in
response.write line. Any help?
Response.Write "<td class=tempdrop1 style='" & sTeamVisible & "'>"
Response.Write RenderTeamFilter(TeamID)
Response.Write "</td>" & vbCrLf
I find it easier to read and manage quotes if I omit them when not necessary
(e.g. around a word like "teamdrop1"). No, this isn't explicitly correct,
but it sure is useful during debugging, especially when working in an editor
that doesn't make a clear distinction between two ' and one " ...
I also find it easier to manage stuff like this if I break separate elements
onto their own line. Your main problem here, I think, is that you forgot to
close the opening <td> tag. So the resulting output (which you would have
been able to discover if you viewed source) was something like:
<td class="teampdrop1" style="visibility: visible" result of
renderTeamFilter(TeamID)</td>
I find little value in adding all these vbCrLf to the output HTML, unless
you really have a need for the output to be tidy (such as debugging complex
and dynamic HTML layout).
Finally, since the default visibility *is* visible, there is no reason to
explicitly declare this style (you could make it an attribute of tempdrop1
class if you really wanted to), the only time you would need to override the
default and explicitly declare a style attribute is if you were setting it
to something *other* than visible. So your ASP code could just as easily
look like this, and the result in terms of appearance and functionality will
be exactly the same:
<%
....
Response.Write "<td class=tempdrop1>"
Response.Write RenderTeamFilter(TeamID)
Response.Write "</td>"
....
%>
or:
<%
....
Response.Write "<td class=tempdrop1>" & RenderTeamFilter(TeamID) & "</td>"
....
%>
or:
<%
....
Response.Write "<td class=tempdrop1>" & _
RenderTeamFilter(TeamID) & "</td>"
....
%>
or:
<td class=tempdrop1><%=RenderTeamFilter(TeamID)%></td>
There are many ways to skin a cat. Some are a little more likely than
others to yield scratches, cuts & bruises.