Wednesday, August 17, 2011

HTML Tags

Don't leave HTML tags open, or close HTML tags that aren't there.

Sure you can write Sad Code like this:
<%
If (HasAccess) Then
%>
      <a href="Secure.asp">
<%
End If
%>
      Secure Link</a>

and it will most likely still show a link, but look at the messy source!

-- If HasAccess = True:
Secure Link

Source:
<a href="Secure.asp">Secure Link</a>

-- If HasAccess = False:
Secure Link

Source:
Secure Link</a>

That little closing anchor tag is not a happy tag!