日期:2014-05-16  浏览次数:20874 次

用asp条调语句if then else end if 来定义文本框的值类,色彩,大小等






<input name="Input"  onclick="oCopy(this)" <%if Recordset1.Fields.Item("drama_hits")>=3 then %>>class="text_160_hong"<%else%>class="text_160"<%end if%> value=<%=(Recordset1.Fields.Item("drama_title").Value)%> 

/>

解读:

一、<%if Recordset1.Fields.Item("drama_hits")>=3 then class="text_160_hong"

当记录集的"drama_hits"大于等于3时class定义为text_160_hong

二、<%else%>class="text_160"

否则class="text_160"

"<%end if%>应该是if then else end if的语句格式,它应该是结束语