Controlla in and e non in or

codice:
if ((test != "") && (test != "undefined"))
   Response.Write("<td>"+test+"</td>");